DEV Community


Posted on

Add Metadata Signatures to PDF Documents using the Java eSignature API

Adding and searching metadata signature functionality for your PDF documents has been introduced as part of the newly released version of GroupDocs.Signature for Java. App developers can programmatically verify encrypted QRCode text, export images as PDF, set e-signature position in Microsoft Excel documents with pixel measurement units; align text in digital signatures for Microsoft Word DOCX, PowerPoint PPTX, PDF documents and Image files within their Java applications -

Below code snippet shows how to add metadata esignature to a PDF file:

// setup options with text of signature
PdfMetadataSignOptions signMetadataOptions = new PdfMetadataSignOptions();
// Specify different Metadata Signatures and add them to options sigature collection
// setup Author property
PdfMetadataSignature mdSign_Author = new PdfMetadataSignature("Author", "Mr.Scherlock Holmes");
// setup data of document id
PdfMetadataSignature mdSign_DocId = new PdfMetadataSignature("DocumentId", java.util.UUID.randomUUID().toString());
// setup data of sign date
PdfMetadataSignature mdSign_Date = new PdfMetadataSignature("SignDate", new Date(), "pdf");

Following code snippet is for searching metadata esignature feature:

// setup search options
PdfSearchMetadataOptions searchOptions = new PdfSearchMetadataOptions();
// search document
SearchResult result ="SignedMetadata.pdf", searchOptions);

Top comments (0)