java.lang.Object
com.lowagie.text.pdf.Barcode
com.lowagie.text.pdf.Barcode128
Deprecated.
Implements the code 128 and UCC/EAN-128. Other symbologies are allowed in raw mode.
The code types allowed
are:
- CODE128 - plain barcode 128.
- CODE128_UCC - support for UCC/EAN-128 with a full list of AI.
- CODE128_RAW - raw mode. The code attribute has the actual codes from 0 to 105 followed by '\uffff' and the human readable text.
x = 0.8f;
font = BaseFont.createFont("Helvetica", "winansi", false);
size = 8;
baseline = size;
barHeight = size * 3;
textAlignment = Element.ALIGN_CENTER;
codeType = CODE128;
- Author:
- Paulo Soares (psoares@consiste.pt)
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final charDeprecated.static final charDeprecated.The charset code change.static final charDeprecated.The charset code change.static final charDeprecated.The charset code change.static final charDeprecated.static final charDeprecated.static final charDeprecated.static final charDeprecated.The code for UCC/EAN-128.static final charDeprecated.static final charDeprecated.static final charDeprecated.static final charDeprecated.static final charDeprecated.The start code.static final charDeprecated.The start code.static final charDeprecated.The start code.static final charDeprecated.static final charDeprecated.static final charDeprecated.Fields inherited from class com.lowagie.text.pdf.Barcode
altText, barHeight, baseline, checksumText, CODABAR, code, CODE128, CODE128_RAW, CODE128_UCC, codeType, EAN13, EAN8, extended, font, generateChecksum, guardBars, inkSpreading, n, PLANET, POSTNET, size, startStopText, SUPP2, SUPP5, textAlignment, UPCA, UPCE, x -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateAwtImage(Color foreground, Color background) Deprecated.Creates ajava.awt.Image.Deprecated.Gets the maximum area that the barcode and the text, if any, will occupy.static byte[]getBarsCode128Raw(String text) Deprecated.Generates the bars.static StringgetHumanReadableUCCEAN(String code) Deprecated.Gets the human readable text of a sequence of AI.static StringgetRawText(String text, boolean ucc) Deprecated.Converts the human readable text to the characters needed to create a barcode.placeBarcode(PdfContentByte cb, Color barColor, Color textColor) Deprecated.Places the barcode in aPdfContentByte.static StringremoveFNC1(String code) Deprecated.Removes the FNC1 codes in the text.voidDeprecated.Sets the code to generate.Methods inherited from class com.lowagie.text.pdf.Barcode
createImageWithBarcode, createTemplateWithBarcode, getAltText, getBarHeight, getBaseline, getCode, getCodeType, getFont, getInkSpreading, getN, getSize, getTextAlignment, getX, isChecksumText, isExtended, isGenerateChecksum, isGuardBars, isStartStopText, setAltText, setBarHeight, setBaseline, setChecksumText, setCodeType, setExtended, setFont, setGenerateChecksum, setGuardBars, setInkSpreading, setN, setSize, setStartStopText, setTextAlignment, setX
-
Field Details
-
CODE_AB_TO_C
public static final char CODE_AB_TO_CDeprecated.The charset code change.- See Also:
-
CODE_AC_TO_B
public static final char CODE_AC_TO_BDeprecated.The charset code change.- See Also:
-
CODE_BC_TO_A
public static final char CODE_BC_TO_ADeprecated.The charset code change.- See Also:
-
FNC1_INDEX
public static final char FNC1_INDEXDeprecated.The code for UCC/EAN-128.- See Also:
-
START_A
public static final char START_ADeprecated.The start code.- See Also:
-
START_B
public static final char START_BDeprecated.The start code.- See Also:
-
START_C
public static final char START_CDeprecated.The start code.- See Also:
-
FNC1
public static final char FNC1Deprecated.- See Also:
-
DEL
public static final char DELDeprecated.- See Also:
-
FNC3
public static final char FNC3Deprecated.- See Also:
-
FNC2
public static final char FNC2Deprecated.- See Also:
-
SHIFT
public static final char SHIFTDeprecated.- See Also:
-
CODE_C
public static final char CODE_CDeprecated.- See Also:
-
CODE_A
public static final char CODE_ADeprecated.- See Also:
-
FNC4
public static final char FNC4Deprecated.- See Also:
-
STARTA
public static final char STARTADeprecated.- See Also:
-
STARTB
public static final char STARTBDeprecated.- See Also:
-
STARTC
public static final char STARTCDeprecated.- See Also:
-
-
Constructor Details
-
Barcode128
public Barcode128()Deprecated.Creates new Barcode128
-
-
Method Details
-
removeFNC1
Deprecated.Removes the FNC1 codes in the text.- Parameters:
code- the text to clean- Returns:
- the cleaned text
-
getHumanReadableUCCEAN
Deprecated.Gets the human readable text of a sequence of AI.- Parameters:
code- the text- Returns:
- the human readable text
-
getRawText
Deprecated.Converts the human readable text to the characters needed to create a barcode. Some optimization is done to get the shortest code.- Parameters:
text- the text to convertucc-trueif it is an UCC/EAN-128. In this case the character FNC1 is added- Returns:
- the code ready to be fed to getBarsCode128Raw()
-
getBarsCode128Raw
Deprecated.Generates the bars. The input has the actual barcodes, not the human readable text.- Parameters:
text- the barcode- Returns:
- the bars
-
getBarcodeSize
Deprecated.Gets the maximum area that the barcode and the text, if any, will occupy. The lower left corner is always (0, 0).- Specified by:
getBarcodeSizein classBarcode- Returns:
- the size the barcode occupies.
-
placeBarcode
Deprecated.Places the barcode in aPdfContentByte. The barcode is always placed at coordinates (0, 0). Use the translation matrix to move it elsewhere.The bars and text are written in the following colors:
table of the colors of the bars and text barColortextColorResult
nullnullbars and text painted with current fill color
barColornullbars and text painted with
barColornulltextColorbars painted with current color
text painted withtextColorbarColortextColorbars painted with
barColor
text painted withtextColor- Specified by:
placeBarcodein classBarcode- Parameters:
cb- thePdfContentBytewhere the barcode will be placedbarColor- the color of the bars. It can benulltextColor- the color of the text. It can benull- Returns:
- the dimensions the barcode occupies
-
createAwtImage
Deprecated.Creates ajava.awt.Image. This image only contains the bars without any text.- Specified by:
createAwtImagein classBarcode- Parameters:
foreground- the color of the barsbackground- the color of the background- Returns:
- the image
-
setCode
Deprecated.Sets the code to generate. If it's an UCC code and starts with '(' it will be split by the AI. This code in UCC mode is valid:(01)00000090311314(10)ABC123(15)060916
-