DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

GroupDocs
GroupDocs

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 - http://bit.ly/2BxcNTd

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");
signMetadataOptions.getMetadataSignatures().add(mdSign_Author);
// setup data of document id
PdfMetadataSignature mdSign_DocId = new PdfMetadataSignature("DocumentId", java.util.UUID.randomUUID().toString());
signMetadataOptions.getMetadataSignatures().add(mdSign_DocId);
// setup data of sign date
PdfMetadataSignature mdSign_Date = new PdfMetadataSignature("SignDate", new Date(), "pdf");
signMetadataOptions.getMetadataSignatures().add(mdSign_Date);

Following code snippet is for searching metadata esignature feature:

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

Top comments (0)

All DEV content is created by the community!

Hey, if you're landing here for the first time, you should know that this website is a global community of folks who blog about their experiences to help folks like you out.

Sign up now if you're curious. It's free!