Package com.google.zxing.pdf417.encoder
Class PDF417
java.lang.Object
com.google.zxing.pdf417.encoder.PDF417
Top-level class for the logic part of the PDF417 implementation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static int[]determineDimensions(int minCols, int maxCols, int minRows, int maxRows, int sourceCodeWords, int errorCorrectionCodeWords) Determine optimal nr of columns and rows for the specified number of codewords.voidgenerateBarcodeLogic(String msg, int errorCorrectionLevel) voidgenerateBarcodeLogic(String msg, int errorCorrectionLevel, boolean autoECI) voidsetCompact(boolean compact) voidsetCompaction(Compaction compaction) voidsetDimensions(int maxCols, int minCols, int maxRows, int minRows) Sets max/min row/col valuesvoidsetEncoding(Charset encoding)
-
Constructor Details
-
PDF417
public PDF417() -
PDF417
public PDF417(boolean compact)
-
-
Method Details
-
getBarcodeMatrix
-
generateBarcodeLogic
- Parameters:
msg- message to encodeerrorCorrectionLevel- PDF417 error correction level to use- Throws:
WriterException- if the contents cannot be encoded in this format
-
generateBarcodeLogic
public void generateBarcodeLogic(String msg, int errorCorrectionLevel, boolean autoECI) throws WriterException - Parameters:
msg- message to encodeerrorCorrectionLevel- PDF417 error correction level to useautoECI- automatically insert ECIs if needed- Throws:
WriterException- if the contents cannot be encoded in this format
-
determineDimensions
protected static int[] determineDimensions(int minCols, int maxCols, int minRows, int maxRows, int sourceCodeWords, int errorCorrectionCodeWords) throws WriterException Determine optimal nr of columns and rows for the specified number of codewords.- Parameters:
minCols- minimum number of columnsmaxCols- maximum number of columnsminRows- minimum number of rowsmaxRows- maximum number of rowssourceCodeWords- number of code wordserrorCorrectionCodeWords- number of error correction code words- Returns:
- dimension object containing cols as width and rows as height
- Throws:
WriterException- when dimensions can't be determined
-
setDimensions
public void setDimensions(int maxCols, int minCols, int maxRows, int minRows) Sets max/min row/col values- Parameters:
maxCols- maximum allowed columnsminCols- minimum allowed columnsmaxRows- maximum allowed rowsminRows- minimum allowed rows
-
setCompaction
- Parameters:
compaction- compaction mode to use
-
setCompact
public void setCompact(boolean compact) - Parameters:
compact- if true, enables compaction
-
setEncoding
- Parameters:
encoding- sets character encoding to use
-