Skip to content

Instantly share code, notes, and snippets.

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/
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