Package com.google.zxing.pdf417
Class PDF417Writer
java.lang.Object
com.google.zxing.pdf417.PDF417Writer
- All Implemented Interfaces:
Writer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
default error correction levelprivate static final int
default white space (margin) around the code -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static BitMatrix
bitMatrixFromBitArray
(byte[][] input, int margin) This takes an array holding the values of the PDF 417private static BitMatrix
bitMatrixFromEncoder
(PDF417 encoder, String contents, int errorCorrectionLevel, int width, int height, int margin, boolean autoECI) Takes encoder, accounts for width/height, and retrieves bit matrixencode
(String contents, BarcodeFormat format, int width, int height) Encode a barcode using the default settings.encode
(String contents, BarcodeFormat format, int width, int height, Map<EncodeHintType, ?> hints) private static byte[][]
rotateArray
(byte[][] bitarray) Takes and rotates the it 90 degrees
-
Field Details
-
WHITE_SPACE
private static final int WHITE_SPACEdefault white space (margin) around the code- See Also:
-
DEFAULT_ERROR_CORRECTION_LEVEL
private static final int DEFAULT_ERROR_CORRECTION_LEVELdefault error correction level- See Also:
-
-
Constructor Details
-
PDF417Writer
public PDF417Writer()
-
-
Method Details
-
encode
public BitMatrix encode(String contents, BarcodeFormat format, int width, int height, Map<EncodeHintType, ?> hints) throws WriterException- Specified by:
encode
in interfaceWriter
- Parameters:
contents
- The contents to encode in the barcodeformat
- The barcode format to generatewidth
- The preferred width in pixelsheight
- The preferred height in pixelshints
- Additional parameters to supply to the encoder- Returns:
BitMatrix
representing encoded barcode image- Throws:
WriterException
- if contents cannot be encoded legally in a format
-
encode
public BitMatrix encode(String contents, BarcodeFormat format, int width, int height) throws WriterException Description copied from interface:Writer
Encode a barcode using the default settings.- Specified by:
encode
in interfaceWriter
- Parameters:
contents
- The contents to encode in the barcodeformat
- The barcode format to generatewidth
- The preferred width in pixelsheight
- The preferred height in pixels- Returns:
BitMatrix
representing encoded barcode image- Throws:
WriterException
- if contents cannot be encoded legally in a format
-
bitMatrixFromEncoder
private static BitMatrix bitMatrixFromEncoder(PDF417 encoder, String contents, int errorCorrectionLevel, int width, int height, int margin, boolean autoECI) throws WriterException Takes encoder, accounts for width/height, and retrieves bit matrix- Throws:
WriterException
-
bitMatrixFromBitArray
This takes an array holding the values of the PDF 417- Parameters:
input
- a byte array of information with 0 is black, and 1 is whitemargin
- border around the barcode- Returns:
- BitMatrix of the input
-
rotateArray
private static byte[][] rotateArray(byte[][] bitarray) Takes and rotates the it 90 degrees
-