Hi fellow iTexters,

I've an issue which I hope you can help me with.

I'm creating a digital signature field in an existing pdf using itext. This
works well for the latest itext version.

Sample Code:

            PdfReader reader=new PdfReader("c:/template.pdf");

            PdfStamper stamp=new PdfStamper(reader,new
FileOutputStream("c:/signed.pdf"));
            stamp.addSignature("My Signature", 1, 20f, 10f, 100f, 100f);
            stamp.close();

So far so good.

Unfortunately some of the pdf's are created with JaperReport, which runs an
older version (1.3.1) of itext.
Based on an example in the book (UnsignedSignatureField.java in chapter 16),
I've tried to use the PdfWriter object of the stamper to get
the addSignature method of the underlying Acroform object, but with no
success.

I'm using the following code sample to do the previous:

            PdfReader reader=new PdfReader("c:/template.pdf");

            PdfStamper stamp=new PdfStamper(reader,new
FileOutputStream("c:/signed.pdf"));
            stamp.getWriter().getAcroForm().addSignature("siganture", 20,
20, 100, 100);
            stamp.close();

I've also tried to use the PdfStamper.createSignature method to add a
signature field but again no result.

Sample code

            PdfReader reader=new PdfReader("c:/template.pdf");
            PdfStamper stamper = PdfStamper.createSignature(reader,new
FileOutputStream("c:/signed.pdf"), '\0');
            stamper.close();


What am I missing so I can add a empty signature field to an existing pdf
created by JasperReport so it can be signed later on?


Thanks

Yannis
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to