com.lowagie.text.pdf
public class Barcode128 extends Barcode
The code types allowed are:
x = 0.8f; font = BaseFont.createFont("Helvetica", "winansi", false); size = 8; baseline = size; barHeight = size * 3; textAlignment = Element.ALIGN_CENTER; codeType = CODE128;
Field Summary | |
---|---|
static IntHashtable | ais |
static byte[][] | BARS The bars to generate the code. |
static byte[] | BARS_STOP The stop bars. |
static char | CODE_A |
static char | CODE_AB_TO_C The charset code change. |
static char | CODE_AC_TO_B The charset code change. |
static char | CODE_BC_TO_A The charset code change. |
static char | CODE_C |
static char | DEL |
static char | FNC1 |
static char | FNC1_INDEX The code for UCC/EAN-128. |
static char | FNC2 |
static char | FNC3 |
static char | FNC4 |
static char | SHIFT |
static char | STARTA |
static char | STARTB |
static char | STARTC |
static char | START_A The start code. |
static char | START_B The start code. |
static char | START_C The start code. |
Constructor Summary | |
---|---|
Barcode128() Creates new Barcode128 |
Method Summary | |
---|---|
Image | createAwtImage(Color foreground, Color background) Creates a java.awt.Image . |
Rectangle | getBarcodeSize() Gets the maximum area that the barcode and the text, if
any, will occupy. |
static byte[] | getBarsCode128Raw(String text) Generates the bars. |
static String | getHumanReadableUCCEAN(String code)
Gets the human readable text of a sequence of AI. |
static String | getPackedRawDigits(String text, int textIndex, int numDigits) Packs the digits for charset C also considering FNC1. |
static String | getRawText(String text, boolean ucc) Converts the human readable text to the characters needed to
create a barcode. |
static boolean | isNextDigits(String text, int textIndex, int numDigits) Returns true if the next numDigits
starting from index textIndex are numeric skipping any FNC1. |
Rectangle | placeBarcode(PdfContentByte cb, Color barColor, Color textColor) Places the barcode in a PdfContentByte . |
static String | removeFNC1(String code)
Removes the FNC1 codes in the text. |
void | setCode(String code)
Sets the code to generate. |
java.awt.Image
. This image only
contains the bars without any text.Parameters: foreground the color of the bars background the color of the background
Returns: the image
Returns: the size the barcode occupies.
Parameters: text the barcode
Returns: the bars
Parameters: code the text
Returns: the human readable text
Parameters: text the text to pack textIndex where to pack from numDigits the number of digits to pack. It is always an even number
Returns: the packed digits, two digits per character
Parameters: text the text to convert ucc true
if it is an UCC/EAN-128. In this case
the character FNC1 is added
Returns: the code ready to be fed to getBarsCode128Raw()
true
if the next numDigits
starting from index textIndex
are numeric skipping any FNC1.Parameters: text the text to check textIndex where to check from numDigits the number of digits to check
Returns: the check result
PdfContentByte
. 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:
|
|
Result |
---|---|---|
|
|
bars and text painted with current fill color |
|
|
bars and text painted with |
|
|
bars painted with current color |
|
|
bars painted with |
Parameters: cb the PdfContentByte
where the barcode will be placed barColor the color of the bars. It can be null
textColor the color of the text. It can be null
Returns: the dimensions the barcode occupies
Parameters: code the text to clean
Returns: the cleaned text
(01)00000090311314(10)ABC123(15)060916
Parameters: code the code to generate