Looking to see if it's possible to generate a barcode in CF 7 or CF8. Ideally, I'd query the db, and write to cfdocument, and include a barcode with record specific data.
Steve Sommers - 16 Oct 2007 18:06 GMT
It is possible, I've done it in the past. Google "bar code generation library
source" and you should be able to find something. I ran into a serious problem
though, I was generating a GIF and visually it seemed correct but whether or
not a reader could actually read the bar seemed to be dependent on the browser
and the printer used to print the bar code. The failure rate was about 50%. If
we were only writing an internal corporate application and had control over the
browser and printers used, we probably could have used it. Unfortunately this
application was for the masses so we crap canned it.
Now we did find an alternative bar code format that was more browser and
printer friendly, I forget the name but it's the blob pattern looking thing
that Fandango and others use. The problem is that the readers that read this
format are a little more expensive and someone holds patent to the format so
there is some hefty licensing fees involved (at least there was 5 or so years
ago when we research this - $10K per server).
Good luck. Hope this helps.
kim il sung - 19 Oct 2007 13:47 GMT
Barbecue - Java barcode generator
http://sourceforge.net/projects/barbecue/
see usage from attached code
<cfparam name="barcode_string" default="0#randrange(10000,20000)#">
<!--- 1 pix --->
<cfscript>
/* string to make a barcode of */
barcode_string = 'ES00345';
/* image handler in the BBQ library (Handles Generating the Image Data) */
bbq_image_handler = CreateObject("java",
"net.sourceforge.barbecue.BarcodeImageHandler");
/* barcode object */
barcode = CreateObject("java",
"net.sourceforge.barbecue.linear.code39.Code39Barcode");
/* create the barcode */
barcode.init(barcode_string,false,true);
/* set some properties */
/* line width */
barcode.setBarWidth(1);
/* show string after barcode bool */
barcode.setDrawingText(true);
/* create a file object to output the image in */
barcode_image =
CreateObject("java","java.io.FileOutputStream").Init(CreateObject("java","java.i
o.File").Init('#expandpath('barcode.png')#'));
/* let BBQ write the image */
bbq_image_handler.writePNG(barcode,barcode_image);
</cfscript>
<!--- link to view barcode --->
<img src="barcode.png"><br>
<cfoutput>#barcode_string#<br></cfoutput>
natg504 - 25 Aug 2008 17:20 GMT
I just downloaded the application (Barbecue - Java barcode generator), and I
would like to use the CF code in the previous post, but I don't know how to set
up Barbecue, since it's in Java. How do those work together? What do I need
to do to set it up?
Thanks
kim il sung - 26 Aug 2008 10:31 GMT
setup is very easy: just copy jar file to cf server custom tags directory.
thats all.
cf server will look from this directory barbecue jar file when executing your cf code.
cheers
Kim il Sung