Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created February 20, 2024 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/1d283e86536274f4e9f4dc67d1f1f53b to your computer and use it in GitHub Desktop.
Save GroupDocsGists/1d283e86536274f4e9f4dc67d1f1f53b to your computer and use it in GitHub Desktop.
How to Sign Word Files with Digital Signature Certificate using Java
// Java code to sign Word files with digital signature certificate using Java
Signature signature = new Signature("path/document.docx");
DigitalSignOptions options = new DigitalSignOptions("certificate.pfx");
options.setImageFilePath("image.jpg");
options.setLeft(100);
options.setTop(100);
options.setPageNumber(1);
options.setPassword("1234567890");
// sign document to file
SignResult result = signature.sign("path/signed-document.docx", options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment