/** * Generates an Acroform with a Signature */ @Test public void main() throws Exception { // step 1: creation of a document-object Document document = new Document(PageSize.A4); // step 2: PdfWriter writer = PdfWriter.getInstance(document, PdfTestBase.getOutputStream("signature.pdf")); // step 3: we open the document document.open(); // step 4: PdfAcroForm acroForm = writer.getAcroForm(); document.add(new Paragraph("Hello World")); acroForm.addSignature("mysig", 73, 705, 149, 759); // step 5: we close the document document.close(); }
/** * Generates an Acroform with a Signature * * @param args * no arguments needed here */ public static void main(String[] args) { System.out.println("Signature"); // step 1: creation of a document-object Document document = new Document(PageSize.A4); try { // step 2: PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(android.os.Environment.getExternalStorageDirectory() + java.io.File.separator + "droidtext" + java.io.File.separator + "signature.pdf")); // step 3: we open the document document.open(); // step 4: PdfAcroForm acroForm = writer.getAcroForm(); document.add(new Paragraph("Hello World")); acroForm.addSignature("mysig", 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(); }
public PdfAnnotationsImp(PdfWriter writer) { acroForm = new PdfAcroForm(writer); }
/** * Use this methods to get the AcroForm object. * Use this method only if you know what you're doing * @return the PdfAcroform object of the PdfDocument */ public PdfAcroForm getAcroForm();
/** * Gets the AcroForm object. * @return the PdfAcroform object of the PdfDocument */ public PdfAcroForm getAcroForm() { return acroForm; }