public final class PDF417
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private BarcodeMatrix |
barcodeMatrix |
private static int[][] |
CODEWORD_TABLE
The codeword table from the Annex A of ISO/IEC 15438:2001(E).
|
private boolean |
compact |
private Compaction |
compaction |
private static float |
DEFAULT_MODULE_WIDTH |
private java.nio.charset.Charset |
encoding |
private static float |
HEIGHT |
private int |
maxCols |
private int |
maxRows |
private int |
minCols |
private int |
minRows |
private static float |
PREFERRED_RATIO |
private static int |
START_PATTERN
The start pattern (17 bits)
|
private static int |
STOP_PATTERN
The stop pattern (18 bits)
|
Modifier and Type | Method and Description |
---|---|
private static int |
calculateNumberOfRows(int m,
int k,
int c)
Calculates the necessary number of rows as described in annex Q of ISO/IEC 15438:2001(E).
|
private int[] |
determineDimensions(int sourceCodeWords,
int errorCorrectionCodeWords)
Determine optimal nr of columns and rows for the specified number of
codewords.
|
private static void |
encodeChar(int pattern,
int len,
BarcodeRow logic) |
private void |
encodeLowLevel(java.lang.CharSequence fullCodewords,
int c,
int r,
int errorCorrectionLevel,
BarcodeMatrix logic) |
void |
generateBarcodeLogic(java.lang.String msg,
int errorCorrectionLevel) |
void |
generateBarcodeLogic(java.lang.String msg,
int errorCorrectionLevel,
boolean autoECI) |
BarcodeMatrix |
getBarcodeMatrix() |
private static int |
getNumberOfPadCodewords(int m,
int k,
int c,
int r)
Calculates the number of pad codewords as described in 4.9.2 of ISO/IEC 15438:2001(E).
|
void |
setCompact(boolean compact) |
void |
setCompaction(Compaction compaction) |
void |
setDimensions(int maxCols,
int minCols,
int maxRows,
int minRows)
Sets max/min row/col values
|
void |
setEncoding(java.nio.charset.Charset encoding) |
private static final int START_PATTERN
private static final int STOP_PATTERN
private static final int[][] CODEWORD_TABLE
private static final float PREFERRED_RATIO
private static final float DEFAULT_MODULE_WIDTH
private static final float HEIGHT
private BarcodeMatrix barcodeMatrix
private boolean compact
private Compaction compaction
private java.nio.charset.Charset encoding
private int minCols
private int maxCols
private int maxRows
private int minRows
public BarcodeMatrix getBarcodeMatrix()
private static int calculateNumberOfRows(int m, int k, int c)
m
- the number of source codewords prior to the additional of the Symbol Length
Descriptor and any pad codewordsk
- the number of error correction codewordsc
- the number of columns in the symbol in the data region (excluding start, stop and
row indicator codewords)private static int getNumberOfPadCodewords(int m, int k, int c, int r)
m
- the number of source codewords prior to the additional of the Symbol Length
Descriptor and any pad codewordsk
- the number of error correction codewordsc
- the number of columns in the symbol in the data region (excluding start, stop and
row indicator codewords)r
- the number of rows in the symbolprivate static void encodeChar(int pattern, int len, BarcodeRow logic)
private void encodeLowLevel(java.lang.CharSequence fullCodewords, int c, int r, int errorCorrectionLevel, BarcodeMatrix logic)
public void generateBarcodeLogic(java.lang.String msg, int errorCorrectionLevel) throws WriterException
msg
- message to encodeerrorCorrectionLevel
- PDF417 error correction level to useWriterException
- if the contents cannot be encoded in this formatpublic void generateBarcodeLogic(java.lang.String msg, int errorCorrectionLevel, boolean autoECI) throws WriterException
msg
- message to encodeerrorCorrectionLevel
- PDF417 error correction level to useautoECI
- automatically insert ECIs if neededWriterException
- if the contents cannot be encoded in this formatprivate int[] determineDimensions(int sourceCodeWords, int errorCorrectionCodeWords) throws WriterException
sourceCodeWords
- number of code wordserrorCorrectionCodeWords
- number of error correction code wordsWriterException
public void setDimensions(int maxCols, int minCols, int maxRows, int minRows)
maxCols
- maximum allowed columnsminCols
- minimum allowed columnsmaxRows
- maximum allowed rowsminRows
- minimum allowed rowspublic void setCompaction(Compaction compaction)
compaction
- compaction mode to usepublic void setCompact(boolean compact)
compact
- if true, enables compactionpublic void setEncoding(java.nio.charset.Charset encoding)
encoding
- sets character encoding to use