itr = doc.GetFieldIterator()
while itr.HasNext():
if itr.Current().GetType() == Field.e_signature and itr.Current().IsAnnot():
signature_found = False
print("Signature field name: " + itr.Current().GetName())
print("Traversing all annotations in the document...")
page_num = 1
page_itr = doc.GetPageIterator()
sig_widget = Annot(itr.Current().GetSDFObj())
sig_widget_rect = sig_widget.GetRect()
while page_itr.HasNext():
page_num = page_num + 1
page = page_itr.Current()
num_annots = page.GetNumAnnots()
i = 0
while i < num_annots:
annot = page.GetAnnot(i)
if not annot.IsValid():
continue
if annot.GetType() == Annot.e_Ink or annot.GetType() == Annot.e_Stamp:
ink_rect = annot.GetRect()
if (sig_widget_rect.Contains(ink_rect.x1, ink_rect.y1) or
sig_widget_rect.Contains(ink_rect.x1, ink_rect.y2) or
sig_widget_rect.Contains(ink_rect.x2, ink_rect.y1) or
sig_widget_rect.Contains(ink_rect.x2, ink_rect.y2)):
signature_found = True
i = i + 1
page_itr.Next()
print()
if signature_found:
print("Signature found")
else:
print("No signature found")
print("------------------------------")
itr.Next()
--
You received this message because you are subscribed to the "PDFTron PDFNet SDK" group (http://www.pdftron.com/pdfnet/forum.html).
---
You received this message because you are subscribed to the Google Groups "PDFTron SDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pdfnet-sdk+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pdfnet-sdk/829a4371-9881-4bed-8719-a5b8d55f4ed8n%40googlegroups.com.