I am having a problem with the Barbecue Barcode Library. I am trying to create a simple code128 barcode, but the image I get is different from what I get from other online (i.e. http://barcode-generator.org) and desktop (i.e. Zing) Barcode generators.
Here is the ColdFusion code I am using:
<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#" />
This outputs the following image:
Yet, here is what I get from the Zing desktop program:
And here is what I get from barcode-generator.org:
Now, I have no issue with the sizing, scaling, etc. But, you can easily tell that the Barbecue-generated image is much different - simply look at the first several bars.
Why is this happening? Is this a Barbecue bug or am I doing something wrong?