Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » iText »

[iText-questions] Modifications List - 1 page(s) modified

Felipe Gaúcho

2007-07-28

Replies:

I am signing a PDF but the Adobe say the document received 1
modification after beign signed. Why ??

Below is the code I am using to sign:

 private void sign(InputStream input, File generatedPdf) throws IOException,
     FileNotFoundException, DocumentException, KeyStoreException,
     NoSuchAlgorithmException, UnrecoverableKeyException {
   PrivateKey pk = (PrivateKey) keystore.getKey(alias, pkPassword
       .toCharArray());
   Certificate[] chain = keystore.getCertificateChain(alias);

   FileOutputStream out = new FileOutputStream(generatedPdf);
   PdfStamper signerStamper = PdfStamper.createSignature(new PdfReader(
       input), out, '\0');

   PdfSignatureAppearance sap = signerStamper.getSignatureAppearance();
   sap.setCrypto(pk, chain, null, PdfSignatureAppearance.WINCER_SIGNED);
   sap.setReason(signatureReason);
   sap.setLocation(signatureLocation);
   sap.setContact(signatureMail);
   sap.setSignDate(Calendar.getInstance());
   // comment next line to have an invisible signature
   sap.setImage(Image.getInstance(getClass().getClassLoader().getResource("files/selo.gif")));
   sap.setVisibleSignature(new Rectangle(700, 350, 725, 374), 1, "cejugcert");
   sap.setSignatureGraphic(Image.getInstance(getClass().getClassLoader().getResource("files/selo.gif")));
   signerStamper.setThumbnail(Image.getInstance(getClass().getClassLoader().getResource("files/selo.gif")),
1);
   signerStamper.close();
 }

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/
©2008 junlu.com - Jax Systems, LLC, U.S.A.