Skip to content

Instantly share code, notes, and snippets.

How to Sign JPEG with QR Code using Java. For more information, please follow link: https://kb.groupdocs.com/signature/java/how-to-sign-jpeg-with-qr-code-using-java/
import com.groupdocs.signature.Signature;
import com.groupdocs.signature.domain.qrcodes.QrCodeTypes;
import com.groupdocs.signature.licensing.License;
import com.groupdocs.signature.options.sign.QrCodeSignOptions;
public class SignJPEGwithQRCodeusingJava {
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 JPEG file
Signature signature = new Signature("input.jpg");
// Create QRCode option with predefined QRCode text
QrCodeSignOptions signOptions = new QrCodeSignOptions("JohnSmith");
// Setup QRCode encoding type
signOptions.setEncodeType(QrCodeTypes.QR);
// set signature position
signOptions.setLeft(200);
signOptions.setTop(200);
signOptions.setPageNumber(1);
// Sign JPEG and save it to disk
signature.sign("output.jpg", signOptions);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment