Last active
July 12, 2023 11:50
How to Add Image Signature to DOCX using Java. For more information, please follow link: https://kb.groupdocs.com/signature/java/how-to-add-image-signature-to-docx-using-java/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.groupdocs.signature.Signature; | |
import com.groupdocs.signature.licensing.License; | |
import com.groupdocs.signature.options.sign.ImageSignOptions; | |
public class AddImageSignaturetoDOCXusingJava { | |
public static void main(String[] args) throws Exception { | |
// Set License to avoid the limitations of Signature library | |
License license = new License(); | |
license.setLicense("GroupDocs.Signature.lic"); | |
// load the source DOCX file | |
Signature signature = new Signature("input.docx"); | |
// Initialize image sign options with signature image's path | |
ImageSignOptions options = new ImageSignOptions("signature.jpg"); | |
options.setLeft(100); | |
options.setTop(100); | |
options.setAllPages(true); | |
// Save output DOCX to disk | |
signature.sign("output.docx", options); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment