【发布时间】:2015-02-05 06:40:51
【问题描述】:
Barbecue Barcode Library 有问题。我正在尝试创建一个简单的 code128 条码,但我得到的图像与我从其他在线(即http://barcode-generator.org)和桌面(即 Zing)条码生成器获得的图像不同。
这是我正在使用的 ColdFusion 代码:
<cfscript>
LOCAL.BarcodeData = "10047846";
LOCAL.BarcodeFactory = CreateObject("java", "net.sourceforge.barbecue.BarcodeFactory");
LOCAL.Barcode = LOCAL.BarCodeFactory.createCode128(LOCAL.BarcodeData);
LOCAL.BarcodeImageHandler = CreateObject("java", "net.sourceforge.barbecue.BarcodeImageHandler");
LOCAL.BarcodeBufferedImage = LOCAL.BarcodeImageHandler.getImage(LOCAL.Barcode);
LOCAL.BarcodeImage = ImageNew(LOCAL.BarcodeBufferedImage);
LOCAL.BarcodeImagePath =
"C:\temp_\barcode-" & LOCAL.BarcodeData & ".jpg";
ImageWrite(LOCAL.BarcodeImage, LOCAL.BarcodeImagePath, 1);
</cfscript>
<cfimage action="writeToBrowser" source="#LOCAL.BarcodeImagePath#" />
这会输出以下图像:
然而,这是我从 Zing 桌面程序中得到的:
这是我从barcode-generator.org 获得的信息:
现在,我对大小、缩放等没有任何问题。但是,您可以很容易地看出烧烤生成的图像有很大不同 - 只需看看前几条。
为什么会这样?这是烧烤错误还是我做错了什么?
【问题讨论】:
-
为什么用 ColdFusion 标记?
-
@ScottStroz 因为我正在使用 ColdFusion 调用库并生成图像。
-
'211214' 模式以烧烤代码开头是 CODE128B 的开始。另外两个“211232”是 CODE128C 的 START。两者都有效。
标签: coldfusion barcode barbecue