本文整理汇总了Java中org.krysalis.barcode4j.impl.code39.Code39Bean类的典型用法代码示例。如果您正苦于以下问题:Java Code39Bean类的具体用法?Java Code39Bean怎么用?Java Code39Bean使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Code39Bean类属于org.krysalis.barcode4j.impl.code39包,在下文中一共展示了Code39Bean类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BarcodeRenderer
import org.krysalis.barcode4j.impl.code39.Code39Bean; //导入依赖的package包/类
public BarcodeRenderer(BarcodeType barcodeType, String code) {
switch (barcodeType) {
case CODE128 : this.barcode = new Code128Bean(); break;
case CODABAR : this.barcode = new CodabarBean(); break;
case CODE39 : this.barcode = new Code39Bean(); break;
case EAN128 : this.barcode = new EAN128Bean(); break;
case DATAMATRIX : this.barcode = new DataMatrixBean(); break;
case INT2OF5 : this.barcode = new Interleaved2Of5Bean(); break;
case PDF417 : this.barcode = new PDF417Bean(); break;
case POSTNET : this.barcode = new POSTNETBean(); break;
case EAN13 : this.barcode = new EAN13Bean(); break;
case EAN8 : this.barcode = new EAN8Bean(); break;
case UPCA : this.barcode = new UPCABean(); break;
case UPCE : this.barcode = new UPCEBean(); break;
case ROYAL_MAIL_CBC : this.barcode = new RoyalMailCBCBean(); break;
case USPS_INTELLIGENT_MAIL : this.barcode = new USPSIntelligentMailBean(); break;
}
this.code = code;
}
示例2: visitCode39
import org.krysalis.barcode4j.impl.code39.Code39Bean; //导入依赖的package包/类
@Override
public void visitCode39(Code39Component code39)
{
Code39Bean code39Bean = new Code39Bean();
barcodeBean = code39Bean;
evaluateCode39(code39);
setBaseAttributes(code39);
if (code39.getChecksumMode() != null)
{
code39Bean.setChecksumMode(ChecksumMode.byName(code39.getChecksumMode()));
}
if (code39.isDisplayChecksum() != null)
{
code39Bean.setDisplayChecksum(code39.isDisplayChecksum().booleanValue());
}
if (code39.isDisplayStartStop() != null)
{
code39Bean.setDisplayStartStop(code39.isDisplayStartStop().booleanValue());
}
if (code39.isExtendedCharSetEnabled() != null)
{
code39Bean.setExtendedCharSetEnabled(code39.isExtendedCharSetEnabled().booleanValue());
}
if (code39.getIntercharGapWidth() != null)
{
code39Bean.setIntercharGapWidth(code39.getIntercharGapWidth().doubleValue());
}
if (code39.getWideFactor() != null)
{
code39Bean.setWideFactor(code39.getWideFactor().doubleValue());
}
evaluateBarcodeRenderable(code39);
}
示例3: getBarcodeCode39
import org.krysalis.barcode4j.impl.code39.Code39Bean; //导入依赖的package包/类
public static Image getBarcodeCode39(String value) {
AbstractBarcodeBean barcode = new Code39Bean();
value = BarcodeString.getBarcodeStringCode39(value);
barcode.setMsgPosition(HumanReadablePlacement.HRP_BOTTOM);
barcode.setModuleWidth(1.0);
barcode.setBarHeight(40.0);
barcode.setFontSize(10.0);
barcode.setQuietZone(10.0);
barcode.doQuietZone(true);
return getBarcode(value, barcode);
}
示例4: main
import org.krysalis.barcode4j.impl.code39.Code39Bean; //导入依赖的package包/类
public static void main(String[] args) {
try {
//Create the barcode bean
Code39Bean bean = new Code39Bean();
final int dpi = 150;
//Configure the barcode generator
bean.setModuleWidth(UnitConv.in2mm(1.0f / dpi)); //makes the narrow bar
//width exactly one pixel
bean.setWideFactor(3);
bean.doQuietZone(false);
//Open output file
File outputFile = new File("out.jpg");
OutputStream out = new FileOutputStream(outputFile);
try {
//Set up the canvas provider for monochrome JPEG output
BitmapCanvasProvider canvas = new BitmapCanvasProvider(
out, "image/jpeg", dpi, BufferedImage.TYPE_BYTE_BINARY, false, 0);
//Generate the barcode
bean.generateBarcode(canvas, "123456");
//Signal end of generation
canvas.finish();
} finally {
out.close();
}
} catch (Exception e) {
e.printStackTrace();
}
}
示例5: code39
import org.krysalis.barcode4j.impl.code39.Code39Bean; //导入依赖的package包/类
public static AbstractBarcodeBean code39(Checksum checksum, boolean displayChecksum,
TextPlacement placement) {
Code39Bean result = new Code39Bean();
result.setChecksumMode(getChecksum(checksum));
result.setDisplayChecksum(displayChecksum);
result.setMsgPosition(getPlacement(placement));
return result;
}
示例6: getBarcodeCode39
import org.krysalis.barcode4j.impl.code39.Code39Bean; //导入依赖的package包/类
public static Image getBarcodeCode39(String value) {
AbstractBarcodeBean barcode = new Code39Bean();
barcode.setMsgPosition(HumanReadablePlacement.HRP_BOTTOM);
return getBarcode(value, barcode);
}
示例7: getBarcodeCode39
import org.krysalis.barcode4j.impl.code39.Code39Bean; //导入依赖的package包/类
/**
*
* @param value
* @return
*/
public static Image getBarcodeCode39(String value) {
AbstractBarcodeBean barcode = new Code39Bean();
barcode.setMsgPosition(HumanReadablePlacement.HRP_BOTTOM);
return getBarcode(value, barcode);
}