Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

[iText-questions] Adding blank signature field

Rynhard Roos

2006-06-16


Hi

I'm trying to add a blank signature field to a pdf. The code I used is
as follows:

PdfReader reader = new PdfReader("d:\\test.pdf");
FileOutputStream fout = new FileOutputStream("d:\\test2.pdf");
PdfStamper stp = PdfStamper.createSignature(reader, fout, '\0');
PdfSignatureAppearance sap = stp.getSignatureAppearance();
sap.setVisibleSignature(new Rectangle(100, 100, 200, 200), 1, null);
stp.close();

When running the code above, I received the following error:
java.lang.NullPointerException
 at com.lowagie.text.pdf.PdfSignatureAppearance.getAppearance(Unknown Source)
 at com.lowagie.text.pdf.PdfSignatureAppearance.preClose(Unknown Source)
 at com.lowagie.text.pdf.PdfSignatureAppearance.preClose(Unknown Source)
 at com.lowagie.text.pdf.PdfStamper.close(Unknown Source)


Is there an example for adding a blank signature field that I can have
a look at?

Thanks
Rynhard


_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
©2008 junlu.com - Jax Systems, LLC, U.S.A.