Java 类com.itextpdf.text.pdf.Barcode 实例源码

项目:tellervo    文件:LabBarcode.java   
/**
 * Construct a new Lab Barcode representing a given UUID and UUID type
 * 
 * @param uuidType One of LabBarcode.Type
 * @param uuid The UUID to encode
 */
public LabBarcode(Type uuidType, UUID uuid) {
    super();

    setCode(encode(uuidType, uuid));
    setAltText(uuidType + " " + uuid.toString());
    setCodeType(Barcode.CODE128);
    setFont(barcodeFont.getBaseFont());
}
项目:SyncRunner-Pub    文件:Barcodes.java   
/**
 * The Config method to creating the desired UPC-A
 * @param cb - PdfContentByte
 * @param upc - A 12 digit String representation of the UPC
 * @return An Image of the UPC
 */
private static Image generateUPC(PdfContentByte cb, String upc){
    BarcodeEAN codeEAN = new BarcodeEAN();
    codeEAN.setCodeType(Barcode.UPCA);
    codeEAN.setCode(upc);
    codeEAN.setSize(7);
    codeEAN.setBaseline(6f);
    codeEAN.setBarHeight(20f);
    codeEAN.setX(.7f);

    return codeEAN.createImageWithBarcode(cb, null, null);
}