Package com.google.zxing.pdf417
Class PDF417Writer
- java.lang.Object
-
- com.google.zxing.pdf417.PDF417Writer
-
-
Field Summary
Fields Modifier and Type Field Description private static intDEFAULT_ERROR_CORRECTION_LEVELdefault error correction levelprivate static intWHITE_SPACEdefault white space (margin) around the code
-
Constructor Summary
Constructors Constructor Description PDF417Writer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static BitMatrixbitMatrixFromBitArray(byte[][] input, int margin)This takes an array holding the values of the PDF 417private static BitMatrixbitMatrixFromEncoder(PDF417 encoder, java.lang.String contents, int errorCorrectionLevel, int width, int height, int margin, boolean autoECI)Takes encoder, accounts for width/height, and retrieves bit matrixBitMatrixencode(java.lang.String contents, BarcodeFormat format, int width, int height)Encode a barcode using the default settings.BitMatrixencode(java.lang.String contents, BarcodeFormat format, int width, int height, java.util.Map<EncodeHintType,?> hints)private static byte[][]rotateArray(byte[][] bitarray)Takes and rotates the it 90 degrees
-
-
-
Field Detail
-
WHITE_SPACE
private static final int WHITE_SPACE
default white space (margin) around the code- See Also:
- Constant Field Values
-
DEFAULT_ERROR_CORRECTION_LEVEL
private static final int DEFAULT_ERROR_CORRECTION_LEVEL
default error correction level- See Also:
- Constant Field Values
-
-
Method Detail
-
encode
public BitMatrix encode(java.lang.String contents, BarcodeFormat format, int width, int height, java.util.Map<EncodeHintType,?> hints) throws WriterException
- Specified by:
encodein 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:
BitMatrixrepresenting encoded barcode image- Throws:
WriterException- if contents cannot be encoded legally in a format
-
encode
public BitMatrix encode(java.lang.String contents, BarcodeFormat format, int width, int height) throws WriterException
Description copied from interface:WriterEncode a barcode using the default settings.- Specified by:
encodein 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:
BitMatrixrepresenting encoded barcode image- Throws:
WriterException- if contents cannot be encoded legally in a format
-
bitMatrixFromEncoder
private static BitMatrix bitMatrixFromEncoder(PDF417 encoder, java.lang.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
private static BitMatrix bitMatrixFromBitArray(byte[][] input, int margin)
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
-
-