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.
2D Barcodes: QR Code, GS1 QR Code, DataMatrix, GS1 DataMatrix, PDF417, Aztec.
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:
de.vwsoft.barcode.Barcode – An abstract superclass for all 1D barcodes
de.vwsoft.barcode.BarcodeFactory – A factory class for creating instances of 1D barcodes
twodcode.TwoDCode – An instantiable class for generating 2D barcode instances
For saving barcodes as graphics:
de.vwsoft.barcode.ImageExporter – Provides a Graphics2D instance and saves the barcode graphic
de.vwsoft.common.awt.CompoundColor – Stores a color as RGB and CMYK