Modifier and Type | Field and Description |
---|---|
private static int |
DEFAULT_ERROR_CORRECTION_LEVEL
default error correction level
|
private static int |
WHITE_SPACE
default white space (margin) around the code
|
Constructor and Description |
---|
PDF417Writer() |
Modifier and Type | Method and Description |
---|---|
private static BitMatrix |
bitMatrixFromBitArray(byte[][] input,
int margin)
This takes an array holding the values of the PDF 417
|
private static BitMatrix |
bitMatrixFromEncoder(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 matrix
|
BitMatrix |
encode(java.lang.String contents,
BarcodeFormat format,
int width,
int height)
Encode a barcode using the default settings.
|
BitMatrix |
encode(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
|
private static final int WHITE_SPACE
private static final int DEFAULT_ERROR_CORRECTION_LEVEL
public BitMatrix encode(java.lang.String contents, BarcodeFormat format, int width, int height, java.util.Map<EncodeHintType,?> hints) throws WriterException
encode
in interface Writer
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 encoderBitMatrix
representing encoded barcode imageWriterException
- if contents cannot be encoded legally in a formatpublic BitMatrix encode(java.lang.String contents, BarcodeFormat format, int width, int height) throws WriterException
Writer
encode
in interface Writer
contents
- The contents to encode in the barcodeformat
- The barcode format to generatewidth
- The preferred width in pixelsheight
- The preferred height in pixelsBitMatrix
representing encoded barcode imageWriterException
- if contents cannot be encoded legally in a formatprivate static BitMatrix bitMatrixFromEncoder(PDF417 encoder, java.lang.String contents, int errorCorrectionLevel, int width, int height, int margin, boolean autoECI) throws WriterException
WriterException
private static BitMatrix bitMatrixFromBitArray(byte[][] input, int margin)
input
- a byte array of information with 0 is black, and 1 is whitemargin
- border around the barcodeprivate static byte[][] rotateArray(byte[][] bitarray)