Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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