|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.lowagie.text.pdf.Barcode | +--com.lowagie.text.pdf.BarcodeCodabar
Implements the code codabar. The default parameters are:
x = 0.8f; n = 2; font = BaseFont.createFont("Helvetica", "winansi", false); size = 8; baseline = size; barHeight = size * 3; textAlignment = Element.ALIGN_CENTER; generateChecksum = false; checksumText = false; startStopText = false;
Field Summary | |
(package private) static byte[][] |
BARS
The bars to generate the code. |
(package private) static String |
CHARS
The index chars to BARS . |
(package private) static int |
START_STOP_IDX
|
Fields inherited from class com.lowagie.text.pdf.Barcode |
barHeight, baseline, checksumText, CODABAR, code, CODE128, CODE128_RAW, CODE128_UCC, codeType, EAN13, EAN8, extended, font, generateChecksum, guardBars, n, PLANET, POSTNET, size, startStopText, SUPP2, SUPP5, textAlignment, UPCA, UPCE, x |
Constructor Summary | |
BarcodeCodabar()
Creates a new BarcodeCodabar. |
Method Summary | |
static String |
calculateChecksum(String code)
|
Rectangle |
getBarcodeSize()
Gets the maximum area that the barcode and the text, if any, will occupy. |
static byte[] |
getBarsCodabar(String text)
Creates the bars. |
Rectangle |
placeBarcode(PdfContentByte cb,
Color barColor,
Color textColor)
Places the barcode in a PdfContentByte . |
Methods inherited from class com.lowagie.text.pdf.Barcode |
createImageWithBarcode, createTemplateWithBarcode, getBarHeight, getBaseline, getCode, getCodeType, getFont, getN, getSize, getTextAlignment, getX, isChecksumText, isExtended, isGenerateChecksum, isGuardBars, isStartStopText, setBarHeight, setBaseline, setChecksumText, setCode, setCodeType, setExtended, setFont, setGenerateChecksum, setGuardBars, setN, setSize, setStartStopText, setTextAlignment, setX |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
static byte[][] BARS
static String CHARS
BARS
.
static final int START_STOP_IDX
Constructor Detail |
public BarcodeCodabar()
Method Detail |
public static byte[] getBarsCodabar(String text)
text
- the text to create the bars
public static String calculateChecksum(String code)
public Rectangle getBarcodeSize()
getBarcodeSize
in class Barcode
public Rectangle placeBarcode(PdfContentByte cb, Color barColor, Color textColor)
PdfContentByte
. The
barcode is always placed at coodinates (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 |
placeBarcode
in class Barcode
cb
- the PdfContentByte
where the barcode will be placedbarColor
- the color of the bars. It can be null
textColor
- the color of the text. It can be null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |