Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Last active February 1, 2024 07:27
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/6bb0d45acb6cc872bc53c12c5eb70f8f to your computer and use it in GitHub Desktop.
Save GroupDocsGists/6bb0d45acb6cc872bc53c12c5eb70f8f to your computer and use it in GitHub Desktop.
How to Sign PDF with Digital Signature Certificate using Java
// Java code to sign PDF with digital signature certificate using Java
Signature signature = new Signature("path/document.pdf");
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.pdf", options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment