Posted By

alexedy on 08/01/12


Tagged

java pdf signature itext


Versions (?)

Get a pdf signature with iTExt 5.3


 / Published in: Java
 

This is a code snippet that retrieves the signatures from a pdf document and the reason for them. It does that in approximately 200ms for one signature.

  1. PdfReader reader = new PdfReader("c:\\sss.pdf");
  2. AcroFields fields = reader.getAcroFields();
  3. for (String signame : fields.getSignatureNames()) {
  4. System.out.println(signame);
  5. PdfDictionary sig = fields.getSignatureDictionary(signame);
  6. System.out.println(sig.getAsString(PdfName.REASON));
  7. }

Report this snippet  

You need to login to post a comment.