PDF-417 Barcode Property Settings





PDF-417 Property Settings


Barcode Java Class: com.onbarcode.barcode.PDF417.
Category Properties Value Comments
Basic Property: data
URL: DATA
Type: String
Default: ""
Barcode value to encode

PDF-417 Valid Data Char Set:
  • 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.
  • 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.
  • Numeric Compaction mode permits efficient encoding of numeric data strings.
  • Up to 811,800 different character sets or data interpretations.
  • Various function codewords for control purposes.

 
PDF 417
Special
Property: processTilde
URL: PROCESS-TILDE
Type: boolean
Default: true
Set the processTilde property to true, if you want use the tilde character "~" to specify special characters in the input data. Default is true.
  • 1-byte character: ~0dd/~1dd/~2dd (character value from 000 ~ 255); ASCII character '~' is presented by ~126
    Strings from "~256" to "~299" are unused
  • 2-byte character (Unicode): ~6ddddd (character value from 00000 ~ 65535)
    Strings from "~665536" to "~699999" are unused
  • Programming for reader initialisation: ~rp.
    This should be located at the beginning of the encoding data, e.g. data = "~rpABCD1234".
  • ECI: ~7dddddd (valid value of dddddd from 000000 to 999999)
Property: dataMode
URL: DATA-MODE
Type: int
Default: 1 (PDF417.M_TEXT)
Valid values:
  • PDF417.M_AUTO (0)
  • PDF417.M_TEXT (1)
  • PDF417.M_BYTE (2)
  • PDF417.M_NUMERIC (3)
Property: ECL
URL: ECL
Type: int
Default: 2 (PDF417.ECL_2)
Error correction level, values are from PDF417.ECL_0 to PDF417.ECL_8.
Property: rowCount
URL: ROW-COUNT
Type: int
Default: 3
The number of rows for PDF417. The value range is from 3 to 90. The default is 3.
Property: columnCount
URL: COLUMN-COUNT
Type: int
Default: 5
Number of columns. The value range is from 1 to 30. The default is 5. Increase this value, if your data size is large.
Property: truncated
URL: TRUNCATED
Type: boolean
Default: false
truncated PDF417 may be used where space considerations are a primary concern and symbol damage is unlikely.
Property: isMacro
URL: MACRO
Type: boolean
Default: false
Set isMacro property to true, then Macro PDF417 is enabled.
Property: macroSegmentIndex
URL: MACRO-SEGMENT-INDEX
Type: int
Default: 0
the position of current symbol in the secuence (Start with 0).
Property: macroSegmentCount
URL: MACRO-SEGMENT-COUNT
Type: int
Default: 0
the number of total symbols which make the sequence.
Property: macroFileIndex
URL: MACRO-FILE-INDEX
Type: int
Default: 0
be identified to the same file
 
Barcode
Size
Related
Property: uom
URL: UOM
Type: int
Default: 0 (pixel)
Unit of meature for all size related settings in the library.
Valid values: 0: pixel; 1: inch; 2: cm.
Property: X
URL: X
Type: float
Default: 3
Barcode bar module width, default is 3 pixel
Property: XtoYRatio
URL: X-Y-RATIO
Type: float
Default: 0.3333333f
Bar width vs bar height ratio
Property: barcodeWidth
URL: BARCODE-WIDTH
Type: float
Default: 0
Barcode image width.

If barcodeWidth setting is smaller than the barcode required minimum width, the library will automatically reset to barcode minimum width.
Property: barcodeHeight
URL: BARCODE-HEIGHT
Type: float
Default: 0
Barcode image height.

If barcodeHeight setting is smaller than the barcode required minimum height, the library will automatically reset to barcode minimum height.
Property: leftMargin
URL: LEFT-MARGIN
Type: float
Default: 0
Barcode image left margin size.
Property: rightMargin
URL: RIGHT-MARGIN
Type: float
Default: 0
Barcode image right margin size.
Property: topMargin
URL: TOP-MARGIN
Type: float
Default: 0
Barcode image top margin size.
Property: bottomMargin
URL: BOTTOM-MARGIN
Type: float
Default: 0
Barcode image bottom margin size.
Property: resolution
URL: RESOLUTION
Type: int
Default: 72
Barcode image resolution in DPI (Dots per inch).
Property: rotate
URL: ROTATE
Type: int
Default: 0 (IBarcode.ROTATE_0)
Valid values:

  • 0 (IBarcode.ROTATE_0)
  • 1 (IBarcode.ROTATE_90)
  • 2 (IBarcode.ROTATE_180)
  • 3 (IBarcode.ROTATE_270)
 
In WebStream query string, please use int value for Enums, "true" and "false" for bool.
 

PDF 417 Properties in the Java Program

Generating barcode PDF 417 in Java Class example

	PDF417 barcode = new PDF417();
	
	barcode.setData("112233445566");
	
	/*
	   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.setDataMode(PDF417.M_AUTO);
	
	// PDF 417 Error Correction Level
	barcode.setEcl(PDF417.ECL_8);
	barcode.setRowCount(30);
	barcode.setColumnCount(5);
	
	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) 1-byte character: ~0dd/~1dd/~2dd (character value from 000 ~ 255); ASCII character '~' is presented by ~126
	//         Strings from "~256" to "~299" are unused
	//       modified to FS, GS, RS and US respectively.
	//  2) 2-byte character (Unicode): ~6ddddd (character value from 00000 ~ 65535)
	//         Strings from "~665536" to "~699999" are unused
	//  3) Programming for reader initialisation: ~rp. 
	//         This should be located at the beginning of the encoding data, e.g. data = "~rpABCD1234".
	//  4) ECI: ~7dddddd (valid value of dddddd from 000000 to 999999)
	barcode.setProcessTilde(true);
	
	/*
	// for macro PDF 417
	barcode.setMacro(false);
	barcode.setMacroSegmentIndex(0);
	barcode.setMacroSegmentCount(0);
	barcode.setMacroFileIndex(0);
	*/
	
	// unit of measure for X, Y, LeftMargin, RightMargin, TopMargin, BottomMargin
	barcode.setUom(IBarcode.UOM_PIXEL);
	// barcode module width in pixel
	barcode.setX(3f);
	barcode.setXtoYRatio(0.3f);
	
	barcode.setLeftMargin(0f);
	barcode.setRightMargin(0f);
	barcode.setTopMargin(0f);
	barcode.setBottomMargin(0f);
	// barcode image resolution in dpi
	barcode.setResolution(72);
	
	/*
	  to save into gif file, file name end with .gif
	  to save into jpeg file, file name end with .jpg
	  to save into eps file, call method drawBarcode2EPS and file name end with .eps
	*/
	barcode.drawBarcode("C:\\pdf417.gif");



Barcode Types