Are you using the latest iText version? I don't see anything wrong but
I'll have a look this weekend.

Paulo 

> -----Original Message-----
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of [EMAIL PROTECTED]
> Sent: Wednesday, April 16, 2008 2:56 PM
> To: [email protected]
> Subject: [iText-questions] To add one signs digitalis in a 
> blank signaturefield
> 
> Please, I need that somebody indicates to me that I am making bad.
> 
> I need to add a digital signature in a  blank signature field 
> previously created, in a certified document.
> 
> This is my code, but it does not work
> 
> Step 1: Add a blank signature field...
> 
>             stp = new PdfStamper(reader, fout);
>                        PdfFormField sig = 
> PdfFormField.createSignature(stp.getWriter());
>             sig.setWidget(new Rectangle(350, 100, 590, 200), null);
>             sig.setFieldFlags(PdfAnnotation.FLAGS_PRINT);
>             sig.put(PdfName.DA, new PdfString("/Helv 0 Tf 0 g"));
>             sig.setFieldName("Signature1");
>             sig.setPage(1);
>             stp.addAnnotation(sig, cant_paginas);
> 
> Step 2: I sign the document with certification level 
> CERTIFIED_FORM_FILLING_AND_ANNOTATIONS
> 
>             stp = PdfStamper.createSignature(reader, fout, 
> '\0',null,true);
>             PdfSignatureAppearance sap = stp.getSignatureAppearance();
>             sap.setCrypto(key, chain, 
> null,PdfSignatureAppearance.WINCER_SIGNED);             
> sap.setReason(razon);
>             sap.setLocation(localidad);
>             
> sap.setCertificationLevel(PdfSignatureAppearance.CERTIFIED_FOR
> M_FILLING_AND_ANNOTATIONS);
> 
>             // comentar las siguientes dos lineas si se quiere una 
> firma invisible
>             int cant_paginas = reader.getNumberOfPages();
> 
>             sap.setVisibleSignature(rectangulo, cant_paginas, null);
>             stp.close();
> 
> Step 3: Add a Signature en blank signature field.
> 
> stp = PdfStamper.createSignature(reader, fout, '\0',new 
> File("temp"),true);
>                        PdfSignatureAppearance sap = 
> stp.getSignatureAppearance();
> 
>             sap.setCrypto(key, chain, null, 
> PdfSignatureAppearance.WINCER_SIGNED);
>             sap.setReason(new String(razon));
>             sap.setLocation(new String(localidad));
>             sap.setVisibleSignature("Signature1");
>             stp.close();


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.


-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Do you like iText?
Buy the iText book: http://www.1t3xt.com/docs/book.php
Or leave a tip: https://tipit.to/itexttipjar

Reply via email to