Barcodes for JasperReports and JasperServer
- Render 80+ barcode symbologies, including 1D, 2D, and postal formats
- Works with JasperReports and JasperServer with Java SE (J2SE) 5+
- Output formats: PNG, JPEG, TIFF, BMP, GIF, EXIF, plus SVG and EMF
Add a barcode to a JasperReports template
// Build report from JRXML + export to PDF (minimal example)
ReportBuilder rb = new ReportBuilder(); rb.setPatternFilePath(path + "builder-params1.jrxml"); rb.addReportParameter("barcode-title1", "EAN14");
BarcodeAttributesGroup g = new BarcodeAttributesGroup("barcode-attributes1");
g.addBarcodeAttribute(BarcodeAttributeName.CodeText, "EAN14");
g.addBarcodeAttribute(BarcodeAttributeName.EncodeType, EncodeTypes.EAN_14);
rb.addBarcodeAttributesGroup(g);
JasperPrint jp = rb.compileReport().getJasperPrint();
JRPdfExporter ex = new JRPdfExporter();
ex.setExporterInput(new SimpleExporterInput(jp));
ex.setExporterOutput(new SimpleOutputStreamExporterOutput(new FileOutputStream(out + "builder-params1.pdf")));
ex.exportReport();
Barcode output that fits your JasperReports workflow
Aspose.BarCode for JasperReports is a pure Java extension that you deploy as a single JAR. It lets report authors place barcodes into reports without building a separate rendering service. This is useful for invoices, shipping labels, tickets, and internal forms where barcode size and clarity matter.
Single JAR deployment
Deploy by copying one JAR into the right location for JasperReports or JasperServer. This keeps setup simple across environments.
Barcodes generated at report render time
Bind barcode values to fields and parameters in your report dataset. The barcode is rendered as part of the normal export and print workflow.
Print-friendly output formats
Render raster images for common exports, or use SVG and EMF when you need crisp scaling for print layouts.
Broad symbology coverage
Use popular 1D and 2D formats in the same reporting stack, including QR Code, Data Matrix, PDF417, and Code 128.
Standards? Covered.
Aspose.BarCode for JasperReports supports all major image formats, including vector formats like SVG and EMF, as well as PDF. Use our API to recognize files from scanners or cameras with ease. Here are all supported barcode symbologies, including 1D, 2D, postal, and composite types. Each one can be generated and recognized across all supported platforms.
Matrix / 2D Codes
- QR Code, MicroQR, rMQR
- Data Matrix, Industrial Data Matrix (DPM)
- Aztec
- Han Xin
- MaxiCode
- DotCode
Linear / 1D Codes
- UPCA, UPCE
- EAN13, EAN14, EAN8
- Code 128
- DataBar
- ITF
- Postal
Industry & Composite Codes
- GS1
- ECI
- Composite barcodes
- HIBC
- SwissQR
- Royal Mailmark
System requirements and deployment options
Aspose.BarCode for JasperReports runs on Java SE (J2SE) 5.0 or higher and integrates with JasperReports and JasperServer. The product documentation lists JasperReports 2.0+ and 3.0+ compatibility. You can use Maven for dependency management, or download the JAR package and deploy it to the JasperReports or JasperServer installation.
Code Example: Parameter-Driven Barcode Styling in JasperReports
Define barcode content and visual attributes as a reusable group, pass values through report parameters, compile the JRXML template, and export a polished PDF — all in a clean, code-first workflow with Aspose.BarCode for JasperReports.
// Input JRXML template path + output PDF path
String patternFilePath = path + "builder-params1.jrxml";
String reportFilePath = out + "builder-params1.pdf";
// Create ReportBuilder (main entry point for assembling the report)
ReportBuilder reportBuilder = new ReportBuilder();
// Define a reusable barcode attributes group (styling + barcode content settings)
BarcodeAttributesGroup attributesGroup = new BarcodeAttributesGroup("barcode-attributes1");
attributesGroup.addBarcodeAttribute(BarcodeAttributeName.CodeText, "EAN14");
attributesGroup.addBarcodeAttribute(BarcodeAttributeName.EncodeType, EncodeTypes.EAN_14);
attributesGroup.addBarcodeAttribute(BarcodeAttributeName.ForeColor, new Color(85, 107, 47));
attributesGroup.addBarcodeAttribute(BarcodeAttributeName.BackColor, new Color(245, 245, 220));
attributesGroup.addBarcodeAttribute(BarcodeAttributeName.BorderColor, new Color(39, 64, 139));
attributesGroup.addBarcodeAttribute(BarcodeAttributeName.BorderVisible, true);
attributesGroup.addBarcodeAttribute(BarcodeAttributeName.BorderWidth, 2);
attributesGroup.addBarcodeAttribute(BarcodeAttributeName.BorderDashStyle, DashStyle.Solid);
// Attach the barcode attributes group + provide report parameters used by the template
reportBuilder.addBarcodeAttributesGroup(attributesGroup);
reportBuilder.addReportParameter("barcode-title1", "Barcode for EAN14");
reportBuilder.addReportParameter("report-title", "Example of ReportBuilder with customer's parameters");
reportBuilder.addReportParameter("author", "Report prepared By Alex");
reportBuilder.setPatternFilePath(patternFilePath);
// Compile the template and get JasperPrint (ready-to-export report instance)
JasperPrint jasperPrint = reportBuilder.compileReport().getJasperPrint();
// Configure PDF exporter (input JasperPrint + PDF settings)
JRPdfExporter exporter = new JRPdfExporter();
ExporterInput exporterInput = new SimpleExporterInput(jasperPrint);
exporter.setExporterInput(exporterInput);
PdfExporterConfiguration pdfExporterConfiguration = new SimplePdfExporterConfiguration();
exporter.setConfiguration(pdfExporterConfiguration);
// Prepare output stream and run export to PDF file
File saveToFile = new File(reportFilePath);
OutputStream outputStream = new FileOutputStream(saveToFile);
SimpleOutputStreamExporterOutput outputStreamExporterOutput = new SimpleOutputStreamExporterOutput(outputStream);
exporter.setExporterOutput(outputStreamExporterOutput);
exporter.exportReport();
Barcodes in reports for billing, logistics, and operations
JasperReports is often used to produce documents that move through operational systems. Adding barcodes makes those documents scannable and reduces manual entry.
- Invoices and statements: encode document IDs and customer references
- Shipping labels and packing slips: include tracking codes and internal routing IDs
- Tickets and passes: generate 2D barcodes for compact payloads
- Asset and inventory reports: add scannable identifiers for reconciliation workflows
- Export-ready images: PNG, JPEG, TIFF, BMP, GIF, EXIF, plus SVG and EMF
Designed for JasperReports teams
Pure Java extension delivered as a single JAR
Use JasperReports fields and parameters to drive barcode values
Output to common raster formats and vector formats for print
Works with JasperReports and JasperServer deployments
80+ barcode symbologies across 1D, 2D, and postal families
Examples and guides for report integration and setup