This java sample program shows how to open a signed PDF and retrieve signature information from it such as signer’s name, sign reason, location, date, etc…. This sample uses Qoppa’s Java PDF Library jPDFSecure but can be easily changed to use jPDFProcess.
// Load the signed document PDFSecure pdfDoc = new PDFSecure ("C:\\test\\output.pdf", null); if(pdfDoc.getSignatureFields() != null && pdfDoc.getSignatureFields().size() >= 1) { // get first signature field SignatureField signField = pdfDoc.getSignatureFields().get(0); // Signature Name / Signature Alias System.out.print("Name " + signField.getSignName()); // Signature Location System.out.print("Location " + signField.getSignLocation()); // Signature Reason System.out.print("Reason " + signField.getSignReason()); // Signature Date / Time System.out.print("Date Time " + signField.getSignDateTime()); } |