java.lang.Object
com.lowagie.text.pdf.BarcodePDF417
Deprecated.
Generates the 2D barcode PDF417. Supports dimensioning auto-sizing, fixed and variable sizes, automatic and manual
error levels, raw codeword input, codeword size optimization and bitmap inversion. The output can be a CCITT G4
Image or a raw bitmap.- Author:
- Paulo Soares (psoares@consiste.pt)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classDeprecated.protected static classDeprecated. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated.static final intDeprecated.The error level correction is set automatically according to ISO 15438 recommendations.static final intDeprecated.The size will be at leastcodeColumnswith a variable number ofcodeRows.static final intDeprecated.The size of the barcode will be at leastcodeColumns*codeRows.static final intDeprecated.The size will be at leastcodeRowswith a variable number ofcodeColumns.static final intDeprecated.One single binary segment is usedstatic final intDeprecated.Inverts the output bits of the raw bitmap that is normally bit one for black.static final intDeprecated.Auto-size is made based onaspectRatioandyHeight.static final intDeprecated.The error level correction is set by the user.static final intDeprecated.Use Macro PDF417 Encodingstatic final intDeprecated.Notextinterpretation is done and the content ofcodewordsis used directly.protected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected BarcodePDF417.SegmentListDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated.protected static final intDeprecated. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.Creates a newBarcodePDF417with the default settings. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidassemble()Deprecated.protected voidbasicNumberCompaction(int start, int length) Deprecated.protected voidbyteCompaction6(int start) Deprecated.protected voidcalculateErrorCorrection(int dest) Deprecated.protected booleancheckSegmentType(BarcodePDF417.Segment segment, char type) Deprecated.createAwtImage(Color foreground, Color background) Deprecated.Creates ajava.awt.Image.floatDeprecated.Gets the barcode aspect ratio.intDeprecated.Gets the number of X pixels ofoutBits.intDeprecated.Gets the number of barcode data columns.intDeprecated.Gets the number of Y pixels ofoutBits.int[]Deprecated.Gets the codeword array.intDeprecated.Gets the error level correction used for the barcode.getImage()Deprecated.Gets anImagewith the barcode.intDeprecated.Gets the length of the codewords.protected intDeprecated.intDeprecated.Gets the options to generate the barcode.byte[]Deprecated.Gets the raw image bits of the barcode.protected intgetSegmentLength(BarcodePDF417.Segment segment) Deprecated.byte[]getText()Deprecated.Gets the bytes that form the barcode.protected intgetTextTypeAndValue(int maxLength, int idx) Deprecated.floatDeprecated.Gets the Y pixel height relative to X.protected static intmaxPossibleErrorLevel(int remain) Deprecated.protected voidnumberCompaction(int start, int length) Deprecated.protected voidoutCodeword(int codeword) Deprecated.protected voidoutCodeword17(int codeword) Deprecated.protected voidoutCodeword18(int codeword) Deprecated.protected voidDeprecated.protected voidDeprecated.protected voidDeprecated.voidDeprecated.Paints the barcode.voidsetAspectRatio(float aspectRatio) Deprecated.Sets the barcode aspect ratio.voidsetCodeColumns(int codeColumns) Deprecated.Sets the number of barcode data columns.voidsetCodeRows(int codeRows) Deprecated.Sets the number of barcode rows.voidDeprecated.Set the default settings that correspond toPDF417_USE_ASPECT_RATIOandPDF417_AUTO_ERROR_LEVEL.voidsetErrorLevel(int errorLevel) Deprecated.Sets the error level correction for the barcode.voidsetLenCodewords(int lenCodewords) Deprecated.Sets the length of the codewords.voidsetMacroFileId(String id) Deprecated.Sets the File ID for macro PDF417 encodingvoidsetMacroSegmentCount(int cnt) Deprecated.Sets the segment count for macro PDF417 encodingvoidsetMacroSegmentId(int id) Deprecated.Sets the segment id for macro PDF417 encodingvoidsetOptions(int options) Deprecated.Sets the options to generate the barcode.voidsetText(byte[] text) Deprecated.Sets the bytes that form the barcode.voidDeprecated.Sets the text that will form the barcode.voidsetYHeight(float yHeight) Deprecated.Sets the Y pixel height relative to X.protected voidtextCompaction(int start, int length) Deprecated.
-
Field Details
-
PDF417_USE_ASPECT_RATIO
public static final int PDF417_USE_ASPECT_RATIODeprecated.Auto-size is made based onaspectRatioandyHeight.- See Also:
-
PDF417_FIXED_RECTANGLE
public static final int PDF417_FIXED_RECTANGLEDeprecated.The size of the barcode will be at leastcodeColumns*codeRows.- See Also:
-
PDF417_FIXED_COLUMNS
public static final int PDF417_FIXED_COLUMNSDeprecated.The size will be at leastcodeColumnswith a variable number ofcodeRows.- See Also:
-
PDF417_FIXED_ROWS
public static final int PDF417_FIXED_ROWSDeprecated.The size will be at leastcodeRowswith a variable number ofcodeColumns.- See Also:
-
PDF417_AUTO_ERROR_LEVEL
public static final int PDF417_AUTO_ERROR_LEVELDeprecated.The error level correction is set automatically according to ISO 15438 recommendations.- See Also:
-
PDF417_USE_ERROR_LEVEL
public static final int PDF417_USE_ERROR_LEVELDeprecated.The error level correction is set by the user. It can be 0 to 8.- See Also:
-
PDF417_FORCE_BINARY
public static final int PDF417_FORCE_BINARYDeprecated.One single binary segment is used- See Also:
-
PDF417_USE_RAW_CODEWORDS
public static final int PDF417_USE_RAW_CODEWORDSDeprecated.Notextinterpretation is done and the content ofcodewordsis used directly.- See Also:
-
PDF417_INVERT_BITMAP
public static final int PDF417_INVERT_BITMAPDeprecated.Inverts the output bits of the raw bitmap that is normally bit one for black. It has only effect for the raw bitmap.- See Also:
-
PDF417_USE_MACRO
public static final int PDF417_USE_MACRODeprecated.Use Macro PDF417 Encoding- See Also:
-
START_PATTERN
protected static final int START_PATTERNDeprecated.- See Also:
-
STOP_PATTERN
protected static final int STOP_PATTERNDeprecated.- See Also:
-
START_CODE_SIZE
protected static final int START_CODE_SIZEDeprecated.- See Also:
-
STOP_SIZE
protected static final int STOP_SIZEDeprecated.- See Also:
-
MOD
protected static final int MODDeprecated.- See Also:
-
ALPHA
protected static final int ALPHADeprecated.- See Also:
-
LOWER
protected static final int LOWERDeprecated.- See Also:
-
MIXED
protected static final int MIXEDDeprecated.- See Also:
-
PUNCTUATION
protected static final int PUNCTUATIONDeprecated.- See Also:
-
ISBYTE
protected static final int ISBYTEDeprecated.- See Also:
-
BYTESHIFT
protected static final int BYTESHIFTDeprecated.- See Also:
-
PL
protected static final int PLDeprecated.- See Also:
-
LL
protected static final int LLDeprecated.- See Also:
-
AS
protected static final int ASDeprecated.- See Also:
-
ML
protected static final int MLDeprecated.- See Also:
-
AL
protected static final int ALDeprecated.- See Also:
-
PS
protected static final int PSDeprecated.- See Also:
-
PAL
protected static final int PALDeprecated.- See Also:
-
SPACE
protected static final int SPACEDeprecated.- See Also:
-
TEXT_MODE
protected static final int TEXT_MODEDeprecated.- See Also:
-
BYTE_MODE_6
protected static final int BYTE_MODE_6Deprecated.- See Also:
-
BYTE_MODE
protected static final int BYTE_MODEDeprecated.- See Also:
-
NUMERIC_MODE
protected static final int NUMERIC_MODEDeprecated.- See Also:
-
ABSOLUTE_MAX_TEXT_SIZE
protected static final int ABSOLUTE_MAX_TEXT_SIZEDeprecated.- See Also:
-
MAX_DATA_CODEWORDS
protected static final int MAX_DATA_CODEWORDSDeprecated.- See Also:
-
MACRO_SEGMENT_ID
protected static final int MACRO_SEGMENT_IDDeprecated.- See Also:
-
MACRO_LAST_SEGMENT
protected static final int MACRO_LAST_SEGMENTDeprecated.- See Also:
-
bitPtr
protected int bitPtrDeprecated. -
cwPtr
protected int cwPtrDeprecated. -
segmentList
Deprecated.
-
-
Constructor Details
-
BarcodePDF417
public BarcodePDF417()Deprecated.Creates a newBarcodePDF417with the default settings.
-
-
Method Details
-
maxPossibleErrorLevel
protected static int maxPossibleErrorLevel(int remain) Deprecated. -
setMacroSegmentId
public void setMacroSegmentId(int id) Deprecated.Sets the segment id for macro PDF417 encoding- Parameters:
id- the id (starting at 0)- See Also:
-
setMacroSegmentCount
public void setMacroSegmentCount(int cnt) Deprecated.Sets the segment count for macro PDF417 encoding- Parameters:
cnt- the number of macro segments- See Also:
-
setMacroFileId
Deprecated.Sets the File ID for macro PDF417 encoding- Parameters:
id- the file id
-
checkSegmentType
Deprecated. -
getSegmentLength
Deprecated. -
setDefaultParameters
public void setDefaultParameters()Deprecated.Set the default settings that correspond toPDF417_USE_ASPECT_RATIOandPDF417_AUTO_ERROR_LEVEL. -
outCodeword17
protected void outCodeword17(int codeword) Deprecated. -
outCodeword18
protected void outCodeword18(int codeword) Deprecated. -
outCodeword
protected void outCodeword(int codeword) Deprecated. -
outStopPattern
protected void outStopPattern()Deprecated. -
outStartPattern
protected void outStartPattern()Deprecated. -
outPaintCode
protected void outPaintCode()Deprecated. -
calculateErrorCorrection
protected void calculateErrorCorrection(int dest) Deprecated. -
getTextTypeAndValue
protected int getTextTypeAndValue(int maxLength, int idx) Deprecated. -
textCompaction
protected void textCompaction(int start, int length) Deprecated. -
basicNumberCompaction
protected void basicNumberCompaction(int start, int length) Deprecated. -
numberCompaction
protected void numberCompaction(int start, int length) Deprecated. -
byteCompaction6
protected void byteCompaction6(int start) Deprecated. -
assemble
protected void assemble()Deprecated. -
getMaxSquare
protected int getMaxSquare()Deprecated. -
paintCode
public void paintCode()Deprecated.Paints the barcode. If no exception was thrown a valid barcode is available. -
getImage
Deprecated.Gets anImagewith the barcode. The image will have to be scaled in the Y direction byyHeightfor the barcode to have the right printing aspect.- Returns:
- the barcode
Image - Throws:
BadElementException- on error
-
createAwtImage
Deprecated.Creates ajava.awt.Image.- Parameters:
foreground- the color of the barsbackground- the color of the background- Returns:
- the image
-
getOutBits
public byte[] getOutBits()Deprecated.Gets the raw image bits of the barcode. The image will have to be scaled in the Y direction byyHeight.- Returns:
- The raw barcode image
-
getBitColumns
public int getBitColumns()Deprecated.Gets the number of X pixels ofoutBits.- Returns:
- the number of X pixels of
outBits
-
getCodeRows
public int getCodeRows()Deprecated.Gets the number of Y pixels ofoutBits. It is also the number of rows in the barcode.- Returns:
- the number of Y pixels of
outBits
-
setCodeRows
public void setCodeRows(int codeRows) Deprecated.Sets the number of barcode rows. This number may be changed to keep the barcode valid.- Parameters:
codeRows- the number of barcode rows
-
getCodeColumns
public int getCodeColumns()Deprecated.Gets the number of barcode data columns.- Returns:
- he number of barcode data columns
-
setCodeColumns
public void setCodeColumns(int codeColumns) Deprecated.Sets the number of barcode data columns. This number may be changed to keep the barcode valid.- Parameters:
codeColumns- the number of barcode data columns
-
getCodewords
public int[] getCodewords()Deprecated.Gets the codeword array. This array is always 928 elements long. It can be written to if the optionPDF417_USE_RAW_CODEWORDSis set.- Returns:
- the codeword array
-
getLenCodewords
public int getLenCodewords()Deprecated.Gets the length of the codewords.- Returns:
- the length of the codewords
-
setLenCodewords
public void setLenCodewords(int lenCodewords) Deprecated.Sets the length of the codewords.- Parameters:
lenCodewords- the length of the codewords
-
getErrorLevel
public int getErrorLevel()Deprecated.Gets the error level correction used for the barcode. It may different from the previously set value.- Returns:
- the error level correction used for the barcode
-
setErrorLevel
public void setErrorLevel(int errorLevel) Deprecated.Sets the error level correction for the barcode.- Parameters:
errorLevel- the error level correction for the barcode
-
getText
public byte[] getText()Deprecated.Gets the bytes that form the barcode. This bytes should be interpreted in the codepage Cp437.- Returns:
- the bytes that form the barcode
-
setText
public void setText(byte[] text) Deprecated.Sets the bytes that form the barcode. This bytes should be interpreted in the codepage Cp437.- Parameters:
text- the bytes that form the barcode
-
setText
Deprecated.Sets the text that will form the barcode. This text is converted to bytes using the encoding Cp437.- Parameters:
s- the text that will form the barcode
-
getOptions
public int getOptions()Deprecated.Gets the options to generate the barcode.- Returns:
- the options to generate the barcode
-
setOptions
public void setOptions(int options) Deprecated.Sets the options to generate the barcode. This can be all thePDF417_*constants.- Parameters:
options- the options to generate the barcode
-
getAspectRatio
public float getAspectRatio()Deprecated.Gets the barcode aspect ratio.- Returns:
- the barcode aspect ratio
-
setAspectRatio
public void setAspectRatio(float aspectRatio) Deprecated.Sets the barcode aspect ratio. A ratio or 0.5 will make the barcode width twice as large as the height.- Parameters:
aspectRatio- the barcode aspect ratio
-
getYHeight
public float getYHeight()Deprecated.Gets the Y pixel height relative to X.- Returns:
- the Y pixel height relative to X
-
setYHeight
public void setYHeight(float yHeight) Deprecated.Sets the Y pixel height relative to X. It is usually 3.- Parameters:
yHeight- the Y pixel height relative to X
-