Skip to content

Instantly share code, notes, and snippets.

How to Sign RTF with Barcode Signature using Java. For more information, please follow link: https://kb.groupdocs.com/signature/java/how-to-sign-rtf-with-barcode-signature-using-java/
import com.groupdocs.signature.Signature;
import com.groupdocs.signature.domain.barcodes.BarcodeTypes;
import com.groupdocs.signature.licensing.License;
import com.groupdocs.signature.options.sign.BarcodeSignOptions;
public class SignRTFwithBarcodeSignatureUsingJava {
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 RTF file
Signature signature = new Signature("input.rtf");
// setup options with text of signature
BarcodeSignOptions signOptions = new BarcodeSignOptions("12345678");
// setup Barcode encoding type
signOptions.setEncodeType(BarcodeTypes.Code128);
// set signature position
signOptions.setLeft(200);
signOptions.setTop(200);
signOptions.setPageNumber(1);
// sign document to file
signature.sign("output.rtf", signOptions);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment