This quick how-to tutorial provides detailed instructions to add image signature to PDF in Java. This guide will use one of the best Signature library for signing the documents by consuming simple APIs. Further, you can find a sample code that demonstrates the implementation of how to sign PDF with image in Java.
Steps to Add Image Signature to PDF in Java
- Install GroupDocs.Signature for Java from the Maven repository in the Java project to sign PDF with image signature
- Add necessary classes for the implementation to add sign image to PDF
- Instantiate Signature class and pass the source PDF to its constructor
- Create an object of the ImageSignOptions class and pass the required image file to the constructor
- Call the Sign method of the Signature class, pass the output PDF file name and ImageSignOptions object to it
The above points can be easily used for creating the functionality to add signature to PDF from image in Java. You can quickly develop signing the PDF document capability by writing three-four lines of code that consume a few API calls. Further, these instructions can be implemented on any operating system like MS Windows, Linux, and Mac OS without installing additional third-party software.
Code to Add Image Signature to PDF in Java
In the preceding example, we have developed the insert signature image in PDF using Java capability by following the steps defined in the previous section. We have defined the left and top positions for the signature and placed the image signature on the first page by specifying the page number parameter. Moreover, you can use a variety of source documents including DOCS, XLSX, PPSM, TSV, PPTX, and many more for adding the image signature.
We have concentrated on the detailed instructions and created a Java program to add JPG signature to PDF. In an earlier article, we discussed how to use Java to sign PDF with Digital Signature, have a look at How to Sign PDF with Digital Signature using Java post for more information.