Tomas, Tomas Vojtech wrote: > I have a problem with reading PDF sent as attachment. There are 3 > signatures that Adobe Reader 9 shows but iText's AcroFields class doesn't > return. > > [...] > > My question is. Is something bad with the document or is it bug of iText?
Something is bad with the document: Its catalog (15 0) references its interactive form dictionary (56 0) which in turn references three fields (65 0, 68 0, 71 0), the three signature fields. So far, so good. The signature fields, though, are not referenced from any page. This is allowed (there once was quite some discussion on this here...), but makes the iText field search in the first part of the fill() method not find the signature fields. Further looking at your PDF, the interactive form dictionary does not contain a SigFlags entry. Thus any conforming PDF reader may assume the default value 0 (cf. ISO-32000:1, Table 218). This value actually is to be interpreted as a bit array where the bit at the lowest position means (cf ibidem, Table 219): > If set, the document contains at least one signature field. This flag > allows a conforming reader to enable user interface items (such as menu > items or pushbuttons) related to signature processing without having to > scan the entire document for the presence of signature fields. Applied to iText --- being non-graphical --- this flag allows iText to decide whether or not to make an additional attempt to find signature fields not referenced from any page. In case of your document the SigFlags default value 0 tells iText that there is no need to look any further. And so it ignores the three signatures... Therefore, you should ask the producer of those signed documents to properly add a SigFlags entry if he wants to make sure his signatures are found and recognized by conforming software. Regards, Michael. PS: Even though the SigFlags are correctly interpreted here by iText, the secondary search throught the fields tree would not take too long or block too many resources. IMO iText should scan that tree whether the lowest SigFlags bit is set or not. -- View this message in context: http://itext-general.2136553.n4.nabble.com/itext-does-not-return-any-signature-tp3036111p3036273.html Sent from the iText - General mailing list archive at Nabble.com. ------------------------------------------------------------------------------ The Next 800 Companies to Lead America's Growth: New Video Whitepaper David G. Thomson, author of the best-selling book "Blueprint to a Billion" shares his insights and actions to help propel your business during the next growth cycle. Listen Now! http://p.sf.net/sfu/SAP-dev2dev _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions Many questions posted to this list can (and will) be answered with a reference to the iText book: http://www.itextpdf.com/book/ Please check the keywords list before you ask for examples: http://itextpdf.com/themes/keywords.php
