Sorry about the misleading information, PdfAcroForm can't be used in PdfStamper. To create a blank signature field in PdfStamper:
PdfFormField sig = PdfFormField.createSignature(stamper.getWriter()); sig.setWidget(new Rectangle(100, 100, 200, 200), null); sig.setFlags(PdfAnnotation.FLAGS_PRINT); sig.put(PdfName.DA, new PdfString("/Helv 0 Tf 0 g")); sig.setFieldName("Signature1"); sig.setPage(); stamper.addAnnotation(sig, 1); > -----Original Message----- > From: James McCarthy [mailto:[EMAIL PROTECTED] > Sent: Tuesday, June 14, 2005 1:34 AM > To: Paulo Soares > Subject: RE: [iText-questions] Adding Signature Field > > Paulo, > > Thanks for your reply. I developed some prototypes today but > I can not get > past an exception being thrown when I call addSignature. The > steps I am > taking are to create a PDF using XSLT and FO. Next I opened > the generated > document using > > PdfStamper stamper = new PdfStamper(new PdfReader(fi), fo); > PdfWriter writer = stamper.getWriter(); > PdfAcroForm acroform = writer.getAcroForm(); > > /* > * Both of the following two lines throws an exception. > */ > acroform.addHiddenField("Test", "Test"); > acroform.addSignature("ROSignature", 0.0f,0.0f,0.0f,0.0f) > > I will see if I can trace it down by running a small test but > I think it has > to do with opening an existing document and the annotations not being > initialized. > > Sincerely, > > Jim McCarthy > > -----Original Message----- > From: Paulo Soares [mailto:[EMAIL PROTECTED] > Sent: Monday, June 13, 2005 6:08 PM > To: [EMAIL PROTECTED]; itext-questions@lists.sourceforge.net > Subject: Re: [iText-questions] Adding Signature Field > > > ----- Original Message ----- > From: "James McCarthy" <[EMAIL PROTECTED]> > To: <itext-questions@lists.sourceforge.net> > Sent: Monday, June 13, 2005 3:40 PM > Subject: [iText-questions] Adding Signature Field > > > > I have searched the archives and did not find anything that > specifically > > addressed my questions so here goes. > > > > I am generating a PDF document using XSLT Formatting > Objects (FO). The > > document does not have any form fields but I would like to add the > following > > once the document is generated: > > > > 1. Add a few hidden fields with meta information about the > document (I > think > > I can figure this one out). > > 2. Add a signature field (hidden or visible) that will > allow the user to > > sign the document using the Adobe Reader. > > > > PdfAcroForm.addSignature() > > > My questions are how to add the signature field for later > signing and does > > the signature field sign the entire document or just the hidden form > fields? > > I need it to sign the entire document. > > > > The signing covers the entire doc. > > > Thanks for your help, > > > > Jim > > > > > > > > > > ------------------------------------------------------- > > This SF.Net email is sponsored by: NEC IT Guy Games. How > far can you > shotput > > a projector? How fast can you ride your desk chair down the > office luge > track? > > If you want to score the big prize, get to know the little guy. > > Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20 > > _______________________________________________ > > iText-questions mailing list > > iText-questions@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/itext-questions > > > > ------------------------------------------------------- This SF.Net email is sponsored by: NEC IT Guy Games. How far can you shotput a projector? How fast can you ride your desk chair down the office luge track? If you want to score the big prize, get to know the little guy. Play to win an NEC 61" plasma display: http://www.necitguy.com/?r _______________________________________________ iText-questions mailing list iText-questions@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/itext-questions