I am using the code sample below to create the file
unsigned_signature_field.pdf. I am trying to capture only the digital
signature and don't need the status "Validity unknown" or "Signature
valid" displayed. Is there a way to turn off the status?
I've tried using the code from SignedPDF.java and I get a null pointer
exception on the statement
stamper.close();
Thanks,
Jeff
Code Sample:
public class UnsignedSignatureField {
/**
* Creates a signed PDF file.
*
* @param args
* no arguments needed here
*/
public static void main(String[] args) {
System.out.println("Chapter 16: example Unsigned Signature Field");
System.out.println("-> Creates a PDF with an unsigned signature
field;");
System.out.println("-> jars needed: iText.jar");
System.out.println("-> files generated in /results subdirectory:");
System.out.println(" unsigned_signature_field.pdf");
// step 1: creation of a document-object
Document document = new Document();
try {
// step 2:
// we create a writer
PdfWriter writer = PdfWriter.getInstance(
// that listens to the document
document,
// and directs a PDF-stream to a file
new FileOutputStream("unsigned_signature_field.pdf"));
// step 3: we open the document
document.open();
// step 4: we add a paragraph to the document
document
.add(new Paragraph("This is a personal message from Laura."));
PdfAcroForm acroForm = writer.getAcroForm();
acroForm.addSignature("foobarsig", 73, 705, 149, 759);
} catch (DocumentException de) {
System.err.println(de.getMessage());
} catch (IOException ioe) {
System.err.println(ioe.getMessage());
}
// step 5: we close the document
document.close();
}
}
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/