Skip to main content
Inspiring
January 30, 2008
Question

Free barcode generator?

  • January 30, 2008
  • 7 replies
  • 12126 views
Does anyone know of a free or 'cheap' barcode generator that will work with
CF?


    This topic has been closed for replies.

    7 replies

    BKBK
    Community Expert
    Community Expert
    April 20, 2012

    Newsgroup_User wrote:

    Does anyone know of a free or 'cheap' barcode generator that will work with CF?

    Hello one and all,

    ColdFusion can go even one better. You can use the iText library, which currently ships with ColdFusion, to generate barcodes!

    Here is a proof of concept:

    <cfscript>

    codeEAN = createobject("java","com.lowagie.text.pdf.BarcodeEAN");

    codeEAN.setCodeType(codeEAN.EAN13);

    codeEAN.setCode("4902555131719");

    color =  createobject("java","java.awt.Color");

    image = codeEAN.createAwtImage(color.black, color.white);

    bufferedImage = createObject("java", "java.awt.image.BufferedImage");

    bufferedImageType = bufferedImage.TYPE_BYTE_GRAY;

    bufferedImage = bufferedImage.init(image.getWidth(JavaCast("null", "")),image.getHeight(JavaCast("null", "")), bufferedImageType);

    graphics2D = bufferedImage.createGraphics();

    graphics2D.drawImage(image,0,0,JavaCast("null", ""));

    barcodeImage = imageNew(bufferedImage);

    </cfscript>

    <cfimage action="writeToBrowser" source="#barcodeImage#" format="jpg">

    Participating Frequently
    March 23, 2013

    Hi BKBK,

    Since I found your post I'm looking for documentation on the iText Coldfusion's library sintax. I'll try to generate Code128C barcodes but not found the exact sintax based on your code.

    Thanks in advance.

    Participating Frequently
    March 27, 2013

    I had a look at the API and I can't see how to set the barcode width. I can set its height with "code128.setBarHeight(x);" but none of the parameters I tried (setX, setN...) seems to affect the overall size of the barcode and, as it gets rendered, it's unusable because the bars are too close to be read once printed.

    I don't know where to look further.

    If I use Coldfusion's ability to resize the resulting image, the result is too fuzzy because the bars become blured and the barcode reader can't read them properly.

    I'm stuck!

    Any suggestion will be much appreciated.

    Thanks in advance.


    Solved with Barbecue http://barbecue.sourceforge.net   !!

    Thnaks.

    BKBK
    Community Expert
    Community Expert
    April 12, 2012

    Newsgroup_User wrote:

    Does anyone know of a free or 'cheap' barcode generator that will work with CF?

    Barbecue.

    Participant
    April 12, 2012

    also im found Code 128 fully functional barcode generator http://www.mbcestore.com.mx/generador/codigo-de-barras/, just linked to my webservice/CFapp and im request string and return image with barcode very usefull

    February 1, 2008
    You may be able to get away with Code 39 font at http://www.barcodesinc.com/free-barcode-font/
    Inspiring
    January 31, 2008
    Looks like that is all about making charts? Where is something about
    generating barcodes?

    "natg504" <webforumsuser@macromedia.com> wrote in message
    news:fnsjfp$sv$1@forums.macromedia.com...
    > http://www.fusioncharts.com/free/


    Inspiring
    January 31, 2008
    January 30, 2008