GroupDocs.Signature for Java

Generate barcode for JPEG

Add barcodes of popular formats to any position in your business documents with GroupDocs.Signature for Java. Our solution provides extensive options to customize barcode signatures.

Steps to generate and add a barcode to JPEG file

GroupDocs.Signature can generate barcodes in various popular formats and place them on JPEG pages. With support for over 60 barcode types, Java applications can easily be enhanced with barcode signing capabilities by incorporating our library.

  1. Provide the JPEG file or stream to be processed.
  2. Pass the barcode text to the BarcodeSignOptions instance.
  3. Customize barcode options such as position, size, etc.
  4. Save the file with the newly added barcode.
// Create a new Signature instance with the document path
Signature signature = new Signature("input.jpeg");

// Use BarcodeSignOptions to add a barcode to the document
BarcodeSignOptions options = new BarcodeSignOptions("Business data");

// Set up the barcode type and other properties
options.setEncodeType(BarcodeTypes.Code128);
options.setLeft(100);
options.setTop(100);

// Save the signed file
signature.sign("output.jpeg", options);
Maven XML
click to copy
copied
More examples Documentation

Enhance or protect document content with signatures

The GroupDocs.Signature for Java library is designed for signing and further processing popular file formats. Quickly and easily add, modify, verify, or delete various types of signatures.

Features of GroupDocs.Signature

Document signing

Sign any page of supported documents with text, images, barcodes, QR codes, or stamps. Add hidden metadata like EXIF in images or protect document content from unauthorized changes using digital certificates.

Signature search and verification

There’s much more you can do with a signed document. We offer verification of signatures to ensure everything is in order. Additionally, you can retrieve a list of all document signatures through a search.

Modify signatures

Most previously added signatures can be modified. Easily correct text, adjust position, or change color.

Delete signatures

Our solution supports full CRUD operations for signatures. Many types of signatures can be deleted from a document when necessary.

How to create a barcode signature

This example demonstrates how to place a customized barcode on JPEG document pages.

Java

// Provide the document to be signed
Signature signature = new Signature("input.jpeg");

// Create signature options with the desired text
BarcodeSignOptions signOptions = new BarcodeSignOptions("Accepted");
signOptions.setEncodeType(BarcodeTypes.Code39FullASCII);

// Set the relative barcode position on the page
signOptions.setVerticalAlignment(VerticalAlignment.Bottom);
signOptions.setHorizontalAlignment(HorizontalAlignment.Left);

// Set the barcode padding from the page edge
Padding padding = new Padding();
padding.setLeft(20);
padding.setTop(180);
signOptions.setMargin(padding);

// Set the color of the bars
signOptions.setForeColor(Color.RED);

// Define the message font style
SignatureFont font = new SignatureFont();
font.setSize(12);
font.setFamilyName("Arial");
signOptions.setFont(font);

// Specify the message position
signOptions.setCodeTextAlignment(CodeTextAlignment.Above);

// Sign and save the document
SignResult signResult = signature.sign("output.jpeg", signOptions);
Maven XML
click to copy
copied
More examples Documentation

About GroupDocs.Signature for Java

GroupDocs.Signature for Java is an advanced signing solution that supports a wide range of signature types. You can sign documents with text, images, barcodes, digital certificates, stamps, and more across 60+ file formats, including PDF, MS Office, images, ZIP files, and other popular business formats. Additionally, signatures in signed documents can be searched, verified, modified, or deleted at any time.
Learn more
About illustration

Ready to get started?

Download GroupDocs.Signature for free or get a trial license for full access!

Useful resources

Explore documentation, code samples, and community support to enhance your experience.

Discover our core capabilities

We proudly present an extensive variety of supported signatures and functions

Sign documents in other formats

Over 60 formats can be signed using our Java API. Apply various signatures to any page or position within the document.

Temporary license tips

1
Sign up with your work email.
Free mail services are not allowed.
2
Use Get a temporary license button on the second step.
 English