- Home
- Products
- Integration
- Tutorial
- Barcode FAQ
- Purchase
- Company
PDF-417, also known as Portable Data File 417, PDF 417, PDF417 Truncated, is a stacked linear barcode symbol format used in a variety of applications.
Generate and create PDF-417 barcode using Java is one of the functions in OnBarcode's
Barcode for Java Generating Java library (jar file), which supports
generating & printing PDF-417 and 20+ other linear & 2D bar codes in Java application and software.
PDF-417 Generator and Reader library, SDK & application
PDF-417 Generator components and software include
.NET PDF-417,
C# PDF-417,
VB.NET PDF-417,
ASP.NET PDF-417,
Android PDF-417,
PDF-417 Generator.
This document is providing a detailed Java sample source code about generating PDF-417 barcodes in Java class using
Java Barcode generation component.
Complete PDF-417 custmoization settings is included in
Java PDF-417 generating guide.
Generating PDF-417 barcode in Java class example:
PDF417 barcode = new PDF417(); /* PDF-417 Valid data char set: 1. Text Compaction mode permits all printable ASCII characters to be encoded, i.e. values 32 - 126 inclusive in accordance with ISO/IEC 646 (IRV), as well as selected control characters. 2. Byte Compaction mode permits all 256 possible 8-bit byte values to be encoded. This includes all ASCII characters value 0 to 127 inclusive and provides for international character set support. 3. Numeric Compaction mode permits efficient encoding of numeric data strings. 4. Up to 811 800 different character sets or data interpretations. 5. Various function codewords for control purposes. */ barcode.setData("112233445566"); // PDF 417 Error Correction Level barcode.setEcl(PDF417.ECL_8); barcode.setRowCount(30); barcode.setColumnCount(5); barcode.setDataMode(PDF417.M_AUTO); barcode.setTruncated(true); // Set the processTilde property to true, if you want use the tilde character "~" to specify special characters in the input data. Default is false. // 1-byte character: ~ddd (character value from 0 ~ 255) // ASCII (with EXT): from ~000 to ~255 // 2-byte character: ~6ddddd (character value from 0 ~ 65535) // Unicode: from ~600000 to ~665535 // ECI: from ~7000000 to ~7999999 barcode.setProcessTilde(true); /* // for macro PDF 417 barcode.setMacro(false); barcode.setMacroSegmentIndex(0); barcode.setMacroSegmentCount(0); barcode.setMacroFileIndex(0); */ // PDF-417 unit of measure for X, Y, LeftMargin, RightMargin, TopMargin, BottomMargin barcode.setUom(IBarcode.UOM_PIXEL); // PDF-417 barcode module width in pixel barcode.setX(3f); barcode.setXtoYRatio(0.3f); barcode.setLeftMargin(10f); barcode.setRightMargin(10f); barcode.setTopMargin(10f); barcode.setBottomMargin(10f); // barcode image resolution in dpi barcode.setResolution(72); barcode.drawBarcode("C:\\pdf417.gif");