This short tutorial will show you how to create QR Code in Java and how to sign a PDF document with a QR Code signature using Java. The following steps help you to easily generate QR Code digital signature and use it to sign a PDF with a few lines of code.
Steps to Sign PDF with QR Code Signature using Java
- Install GroupDocs.Signature for Java from Maven repository in Java application
- Add necessary classes for signing PDF with QR-Code signature in Java
- Initialize Signature class and pass the source PDF to its constructor
- Set signing options for the output PDF document by creating an instance of the QrCodeSignOptions class
- Call the Sign method of the Signature class, pass the signed PDF file name along with QrCodeSignOptions
Java QR Code generator feature can be implemented by following the above steps in a sequence with a few API calls. You can start configuring the project by installing the required library from the Maven repository and adding the necessary classes. After that, use the Signature class for loading the input PDF file and QrCodeSignOptions class for setting properties for the QR-Code signature. In the end, the Sign method will add a signature to a PDF document and save it to a disk.
Code to Sign PDF with QR Code Signature using Java
We have developed the preceding example how you can use Java code to generate QR Code and consume the generated QR-Code to eSign the PDF document. We have defined the left and top positions for the signature position in the above sample code. Further, you may use many other parameters for the signature position.