Hi Paulo

Works great thanks!!

On 6/16/06, Paulo Soares <[EMAIL PROTECTED]> wrote:
> PdfReader pdf = new PdfReader("in.pdf");
> PdfStamper stp = new PdfStamper(pdf, new FileOutputStream("out.pdf"));
> PdfFormField sig = PdfFormField.createSignature(stp.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(1);
> stp.addAnnotation(sig, 1);
> stp.close();
>
> Paulo
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED]
> > [mailto:[EMAIL PROTECTED] On
> > Behalf Of Rynhard Roos
> > Sent: Friday, June 16, 2006 12:22 PM
> > To: itext-questions@lists.sourceforge.net
> > Subject: [iText-questions] Adding blank signature field
> >
> > 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(Unkn
> > own 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@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/itext-questions
> >
>
>
> Aviso Legal:
> Esta mensagem é destinada exclusivamente ao destinatário. Pode conter 
> informação confidencial ou legalmente protegida. A incorrecta transmissão 
> desta mensagem não significa a perca de confidencialidade. Se esta mensagem 
> for recebida por engano, por favor envie-a de volta para o remetente e 
> apague-a do seu sistema de imediato. É proibido a qualquer pessoa que não o 
> destinatário de usar, revelar ou distribuir qualquer parte desta mensagem.
>
> Disclaimer:
> This message is destined exclusively to the intended receiver. It may contain 
> confidential or legally protected information. The incorrect transmission of 
> this message does not mean the loss of its confidentiality. If this message 
> is received by mistake, please send it back to the sender and delete it from 
> your system immediately. It is forbidden to any person who is not the 
> intended receiver to use, distribute or copy any part of this message.
>
>
>
>
>
>
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
>
>


_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Reply via email to