Hello iText team,
I already have some working code which signs an empty signature field that
was added to a pdf by itext. This was nicely documented in the book and
there are plently of messages concerning that point in this mailing list or
in other sites such as stackoverflow, therefore I got no issue in this.
But now, I have to sign an XFA signature field in a static PDF form
(template written with Livecycle Designer and the pdf is rendered by
Liveycle). I have no control on this.
The issue is that I always get an illegal argument exception telling that
the field Form[0].Page1[0].SignatureForm[0].SignatureField[0] does not
exist, although I can see it with Adobe Reader. I'm sure the full field
path is correct.
I'm using iText 5.3.2 and my code, which is inspired from the latest white
paper of Bruno Lowalgie, looks like the following :
PdfReader reader = new PdfReader(src);
PdfStamper stamper = PdfStamper.createSignature(reader, dest, '\0',
null, true);
// Creating the appearance
PdfSignatureAppearance appearance =
stamper.getSignatureAppearance();
appearance.setReason(reason);
appearance.setLocation(location);
appearance.setVisibleSignature(signatureFieldName);
appearance.setCertificationLevel(PdfSignatureAppearance.CERTIFIED_FORM_FILLING_AND_ANNOTATIONS);
// Creating the signature
ExternalDigest digest = new BouncyCastleDigest();
ExternalSignature signature = new PrivateKeySignature(pk,
digestAlgorithm, provider);
MakeSignature.signDetached(appearance, digest, signature,
chain,null, null, null, 0, subfilter);
In the XML of the form, the field is :
<field minH="12.962mm" minW="81.262mm" name="SignatureField"
x="0.287mm" y="12.706mm">
<ui>
<signature type="PDF1.6">
<filter>
<certificates>
<keyUsage nonRepudiation="yes" type="required"/>
</certificates>
</filter>
</signature>
</ui>
<para vAlign="bottom"/>
<bind match="none"/>
</field>
Could you tell me if I can sign that empty field with iText (I'm pretty
sure this is possible), and where I could find some documentation to
achieve it ?
Kind regards,
Julian Janssens
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
_______________________________________________
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