Barcode Software

Barcode-Lib4J (Open Source) - Generating Barcodes in Java

BARCODE-Lib4J – A Proven Open Source Barcode Library for Java. It allows you to generate barcodes and save barcode graphics in vector (EPS, PDF, SVG) and bitmap formats (PNG, BMP, JPG).

Generating Barcodes with Java – QR Code, EAN & more

  • Drawing and printing 1D & 2D barcodes using Java2D (java.awt.Graphics2D)
  • Exporting to PDF: Compliance with PDF/X-1a:2001 for CMYK and PDF/X-3:2002 for RGB
  • Exporting to EPS: Generation of an optional embedded TIFF preview, supports RGB and CMYK colors
  • Exporting to SVG: Supports RGB colors only
  • Barcode precision: Coordinates are stored with up to 6 decimal places in all supported vector formats
  • Exporting to PNG, BMP, JPG: DPI resolution stored in file header. No unwanted effects such as aliasing, etc.
  • Adjustment of bar widths to printer resolution (essential for proper barcode quality at <= 600 dpi)
  • Bar width reduction/correction (useful for addressing ink spread on inkjet printers)
  • Barcodes include minimum distances ("quiet zones")
  • Barcode number placement options: on top, bottom, or invisible
  • Customizable plain text line: font + font size, spacing, modifiable content
  • Automatic font size adjustment, if desired
  • Advanced setting: enables printing with a user-defined module width
  • Optionally transparent background (Supported in EPS, PDF, SVG and PNG)
  • Rotation in 90-degree increments
  • Configurable ratio from 2:1 to 3:1 for barcode types that support it
  • Add-On 2/5 for barcodes like EAN-13, EAN-8, ISBN-13 and UPC-A, second plain text line for ISBN and ISMN
  • Comprehensive support for GS1 barcodes: Includes data integrity checks, validation of application identifiers, checks for length and content of user data, verification/calculation of the check digit in SSCC and GTIN and more.
Barcode-Lib4J Version: 1.0
Size: 1 MB
License: Apache 2.0
Minimum Java: 9

Library JARs
+ Java Source Code
+ Tutorial:
Tutorial for EAN/GS1-128

Supported 1D and 2D Barcodes

Include Barcode-Lib4J in your own Java project

Add barcode-lib4j.jar to your Java project's CLASSPATH. For optional PDF export, include tiny-openpdf-1.3.30.jar. This latter library is also necessary if you want to compile “Barcode-Lib4J” from the provided Java source code yourself.

Library usage

You will need to interact with only a limited number of Java classes: For saving barcodes as graphics: