Skip to content

Instantly share code, notes, and snippets.

@conholdate-gists
Last active April 22, 2021 16:55
Show Gist options
  • Save conholdate-gists/302a649c27e9a1517f7b9a9902e9843c to your computer and use it in GitHub Desktop.
Save conholdate-gists/302a649c27e9a1517f7b9a9902e9843c to your computer and use it in GitHub Desktop.
Sign Documents with Digital Signatures using GroupDocs.Signatures for Java
Sign Documents with Digital Signatures using Java
1. Sign PDF Documents using Java
2. Sign Word Documents using Java
Signature signature = new Signature("sample.docx");
// Define digital sign options
DigitalSignOptions options = new DigitalSignOptions("Signature.pfx");
options.setImageFilePath("signature.jpg");
options.setPassword("1234567890");
options.setReason("Approved");
options.setContact("John Smith");
options.setLocation("New York");
options.setAllPages(true);
options.setWidth(160);
options.setHeight(80);
options.setTop(400);
options.setLeft(100);
// Sign document to file
signature.sign("output.docx", options);
Signature signature = new Signature("sample.pdf");
// Define digital sign options
DigitalSignOptions options = new DigitalSignOptions("Signature.pfx");
options.setImageFilePath("signature.jpg");
options.setLeft(100);
options.setTop(200);
options.setPageNumber(1);
// Sign document to file
signature.sign("output.pdf", options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment