Oscar,

Oscar P wrote:
> 
> Hi again,
> 
> thaks for all answer.
> 
> how i can sign in append mode to obtain original PDF? 
> 
> I sign with this code:
> 
>               PdfReader reader;
>               PrivateKey privateKey = null;
>               Certificate[] chain = null;
>               privateKey = alm.getClavePrivada(alias, pwdPrivateKey);
>               chain = alm.getKeyStore().getCertificateChain(alias);
>               reader = new PdfReader(entrada);
>               PdfStamper stamper;
>               stamper = PdfStamper.createSignature(reader, salida, 
> '\0',null,true);
> //this true is to append mode?
> 

Yes, it is.


Oscar P wrote:
> 
>               PdfSignatureAppearance appearance = 
> stamper.getSignatureAppearance();
>               appearance.setCrypto(privateKey,chain,
> null,PdfSignatureAppearance.WINCER_SIGNED);
>               Calendar signedDate = new GregorianCalendar();
>               appearance.setSignDate(signedDate);
>               try {
>                       stamper.close();
>               } catch (Exception e) {
>                       throw new CifraFirmaException("Error al realizar la 
> firma, no se pudo
> leer correctamente el PDF",e);
>               }
> 
> When i sign i get a unique revision, and this revision include the
> signature field.
> 
> 
> thaks for all.
> 

Yes, the revision you create includes the signature field. The document
should also contain the former revision. I actually use a slightly different
approach here, but yours should also have that older revision inside. If
you're not sure, just post an example document and we'll check.

Regards,   Michael.

-- 
View this message in context: 
http://www.nabble.com/Signature-PDF.-How-obtain-Original-PDF-tp23620527p23643419.html
Sent from the iText - General mailing list archive at Nabble.com.


------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
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