Massa Alfonso wrote
> Anyone can help me? There is a bug in the signature sw or in the itext
> library?

The signature field claims it has a widget annotation on the page
represented by the object 1 0 indicated by the form field type Annot and
subtype Widget (which means that this form field dictionary has a single
widget annotation dictionary merged into it) in combination with the P value
(by which an annotation points to its page object).

21 0 obj
<<
/FT /Sig
/T (firmacertasign_1)
/Type /Annot
/Subtype /Widget
/F 132
/P 1 0 R
/AP <<
>>/Rect [
0
0
0
0
]/V 22 0 R
>>
endobj

On the other hand the referenced page dictionary claims not to have any
annotations as it has no Annots array:

1 0 obj
<</Type /Page/Parent 6 0 R/Resources 13 0 R/MediaBox [0  0  595  842 ]/Group
&lt;&lt;/S /Transparency/CS /DeviceRGB/I true>>/Contents 2 0 R>>
endobj 

This structure is questionable and suspect even if the specification may be
read in a way to call this valid (Annots is an optional page entry but
commonly it is assumed that it is optional only if the page has no
annotations).

The method AcroFields.removeField(String, int) hickups when confronted with
such a situation:

            int pageV = item.getPage(k).intValue();
            if (page != -1 && page != pageV)
                continue;
            PdfIndirectReference ref = item.getWidgetRef(k);
            PdfDictionary wd = item.getWidget( k );
            PdfDictionary pageDic = reader.getPageN(pageV);
            PdfArray annots = pageDic.getAsArray(PdfName.ANNOTS);

If a form field is not referenced from any document page, pageV is -1, so
pageDic is null and pageDic.getAsArray results in a NullPointerException.

To answer your question, therefore, this a a dubious construct created by
the signature software which then is processed by iText code not
sufficiently defensively programmed.

Regards,   Michael



--
View this message in context: 
http://itext.2136553.n4.nabble.com/trying-to-remove-a-signature-from-pdf-file-tp4660983p4660984.html
Sent from the iText mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
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

Reply via email to