我遇到了烧烤条形码库的问题。我正在尝试创建一个简单的 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 得到的:
现在,我对大小、缩放等没有任何问题。但是,您可以很容易地看出烧烤生成的图像有很大不同 - 只需查看前几条。
为什么会这样?这是烧烤错误还是我做错了什么?