public class Barcode128 extends Barcode
The code types allowed are:
x = 1f; font = new Font("Helvetica",Font.PLAIN,20)); textAlignment = ALIGN_CENTER; codeType = CODE128; transparent = true; shotText = true quietZone = true; quietZoneX = 10;This class is based on iText "A Free Java-PDF library by Bruno Lowagie and Paulo Soares" using the Mozilla Public License(MPL)
Modifier and Type | Field and Description |
---|---|
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 |
FNC1
The code for UCC/EAN-128.
|
static char |
START_A
The start code.
|
static char |
START_B
The start code.
|
static char |
START_C
The start code.
|
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, backgroundColor, barHeight, checksumText, CODABAR, code, CODE128, CODE128_RAW, CODE128_UCC, CODE93, codeType, EAN13, EAN8, extended, font, generateChecksum, guardBars, n, PLANET, POSTNET, quietZone, quietZoneX, showText, size, startStopText, SUPP2, SUPP5, textAlignment, transparent, TYPE_CODE128, TYPE_CODE93, TYPE_INTERLEAVED2OF5, UPCA, UPCE, x
Constructor and Description |
---|
Barcode128()
Creates new Barcode128
|
Modifier and Type | Method and Description |
---|---|
int |
getBarcodeWidth()
Gets the maximum width that the barcode will occupy.
|
static byte[] |
getBarsCode128Raw(java.lang.String text)
Generates the bars.
|
static java.lang.String |
getRawText(java.lang.String text,
boolean ucc)
Converts the human readable text to the characters needed to
create a barcode.
|
void |
placeBarcode(Image i,
int barColor,
int textColor)
Places the barcode in a BufferedImage.
|
createImage, createImage, getBackgroundColor, getBarHeight, getCode, getCodeType, getFont, getFontName, getFontSize, getN, getQuietZoneX, getSize, getTextAlignment, getX, isChecksumText, isExtended, isGenerateChecksum, isGuardBars, isQuietZone, isShowText, isStartStopText, isTransparent, scale, setBackgroundColor, setBarHeight, setChecksumText, setCode, setCodeType, setExtended, setFont, setFontName, setFontSize, setFontStyle, setGenerateChecksum, setGuardBars, setN, setQuietZone, setQuietZoneX, setShowText, setSize, setStartStopText, setTextAlignment, setTransparent, setX
public static final char CODE_AB_TO_C
public static final char CODE_AC_TO_B
public static final char CODE_BC_TO_A
public static final char FNC1
public static final char START_A
public static final char START_B
public static final char START_C
public int getBarcodeWidth()
getBarcodeWidth
in class Barcode
public static byte[] getBarsCode128Raw(java.lang.String text)
text
- the barcodepublic static java.lang.String getRawText(java.lang.String text, boolean ucc)
text
- the text to convertucc
- true
if it is an UCC/EAN-128. In this case
the character FNC1 is addedpublic void placeBarcode(Image i, int barColor, int textColor)
|
|
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
i
- the Image
where the barcode will be placedbarColor
- the color of the bars. It can be -1
textColor
- the color of the text. It can be -1