Save This Page
Home » iText-src-2.1.3 » com.lowagie » text » pdf » [javadoc | source]
com.lowagie.text.pdf
public class: BarcodeEAN [javadoc | source]
java.lang.Object
   com.lowagie.text.pdf.Barcode
      com.lowagie.text.pdf.BarcodeEAN
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 = "";
Fields inherited from com.lowagie.text.pdf.Barcode:
EAN13,  EAN8,  UPCA,  UPCE,  SUPP2,  SUPP5,  POSTNET,  PLANET,  CODE128,  CODE128_UCC,  CODE128_RAW,  CODABAR,  x,  n,  font,  size,  baseline,  barHeight,  textAlignment,  generateChecksum,  checksumText,  startStopText,  extended,  code,  guardBars,  codeType,  inkSpreading,  altText
Constructor:
 public BarcodeEAN() 
Method from com.lowagie.text.pdf.BarcodeEAN Summary:
calculateEANParity,   convertUPCAtoUPCE,   createAwtImage,   getBarcodeSize,   getBarsEAN13,   getBarsEAN8,   getBarsSupplemental2,   getBarsSupplemental5,   getBarsUPCE,   placeBarcode
Methods from com.lowagie.text.pdf.Barcode:
createAwtImage,   createImageWithBarcode,   createTemplateWithBarcode,   getAltText,   getBarHeight,   getBarcodeSize,   getBaseline,   getCode,   getCodeType,   getFont,   getInkSpreading,   getN,   getSize,   getTextAlignment,   getX,   isChecksumText,   isExtended,   isGenerateChecksum,   isGuardBars,   isStartStopText,   placeBarcode,   setAltText,   setBarHeight,   setBaseline,   setChecksumText,   setCode,   setCodeType,   setExtended,   setFont,   setGenerateChecksum,   setGuardBars,   setInkSpreading,   setN,   setSize,   setStartStopText,   setTextAlignment,   setX
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.lowagie.text.pdf.BarcodeEAN Detail:
 public static int calculateEANParity(String code) 
    Calculates the EAN parity character.
 public static String convertUPCAtoUPCE(String text) 
    Converts an UPCA code into an UPCE code. If the code can not be converted a null is returned.
 public Image createAwtImage(Color foreground,
    Color background) 
    Creates a java.awt.Image. This image only contains the bars without any text.
 public Rectangle getBarcodeSize() 
    Gets the maximum area that the barcode and the text, if any, will occupy. The lower left corner is always (0, 0).
 public static byte[] getBarsEAN13(String _code) 
    Creates the bars for the barcode EAN13 and UPCA.
 public static byte[] getBarsEAN8(String _code) 
    Creates the bars for the barcode EAN8.
 public static byte[] getBarsSupplemental2(String _code) 
    Creates the bars for the barcode supplemental 2.
 public static byte[] getBarsSupplemental5(String _code) 
    Creates the bars for the barcode supplemental 5.
 public static byte[] getBarsUPCE(String _code) 
    Creates the bars for the barcode UPCE.
 public Rectangle placeBarcode(PdfContentByte cb,
    Color barColor,
    Color textColor) 
    Places the barcode in a 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:

    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