| java.lang.Object com.lowagie.text.pdf.Barcode com.lowagie.text.pdf.BarcodeEAN
BarcodeEAN | public class BarcodeEAN extends Barcode (Code) | | Generates barcodes in several formats: EAN13, EAN8, UPCA, UPCE,
supplemental 2 and 5. The default parameters are:
x = 0.8f;
font = BaseFont.createFont("Helvetica", "winansi", false);
size = 8;
baseline = size;
barHeight = size * 3;
guardBars = true;
codeType = EAN13;
code = "";
author: Paulo Soares (psoares@consiste.pt) |
BarcodeEAN | public BarcodeEAN()(Code) | | Creates new BarcodeEAN
|
calculateEANParity | public static int calculateEANParity(String code)(Code) | | Calculates the EAN parity character.
Parameters: code - the code the parity character |
convertUPCAtoUPCE | public static String convertUPCAtoUPCE(String text)(Code) | | Converts an UPCA code into an UPCE code. If the code can not
be converted a null is returned.
Parameters: text - the code to convert. It must have 12 numeric characters the 8 converted digits or null if thecode could not be converted |
createAwtImage | public java.awt.Image createAwtImage(Color foreground, Color background)(Code) | | Creates a java.awt.Image . This image only
contains the bars without any text.
Parameters: foreground - the color of the bars Parameters: background - the color of the background the image |
getBarcodeSize | public Rectangle getBarcodeSize()(Code) | | Gets the maximum area that the barcode and the text, if
any, will occupy. The lower left corner is always (0, 0).
the size the barcode occupies. |
getBarsEAN13 | public static byte[] getBarsEAN13(String _code)(Code) | | Creates the bars for the barcode EAN13 and UPCA.
Parameters: _code - the text with 13 digits the barcode |
getBarsEAN8 | public static byte[] getBarsEAN8(String _code)(Code) | | Creates the bars for the barcode EAN8.
Parameters: _code - the text with 8 digits the barcode |
getBarsSupplemental2 | public static byte[] getBarsSupplemental2(String _code)(Code) | | Creates the bars for the barcode supplemental 2.
Parameters: _code - the text with 2 digits the barcode |
getBarsSupplemental5 | public static byte[] getBarsSupplemental5(String _code)(Code) | | Creates the bars for the barcode supplemental 5.
Parameters: _code - the text with 5 digits the barcode |
getBarsUPCE | public static byte[] getBarsUPCE(String _code)(Code) | | Creates the bars for the barcode UPCE.
Parameters: _code - the text with 8 digits the barcode |
placeBarcode | public Rectangle placeBarcode(PdfContentByte cb, Color barColor, Color textColor)(Code) | | Places the barcode in a 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:
barColor
|
textColor
|
Result |
null
|
null
|
bars and text painted with current fill color |
barColor
|
null
|
bars and text painted with barColor |
null
|
textColor
|
bars painted with current color text painted with textColor |
barColor
|
textColor
|
bars painted with barColor text painted with textColor |
Parameters: cb - the PdfContentByte where the barcode will be placed Parameters: barColor - the color of the bars. It can be null Parameters: textColor - the color of the text. It can be null the dimensions the barcode occupies |
|
|