• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to generate barcode in coldfusion 10?

Guest
Nov 17, 2013 Nov 17, 2013

Copy link to clipboard

Copied

Hi!

Can someone teach or refer to any link to generate barcode in coldfusion 10?

I did try in cf8 and it works but not in cf10. Please help

Views

2.3K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 18, 2013 Nov 18, 2013

Copy link to clipboard

Copied

LATEST

Hi, we use jQuery. It's very low overhead. Search for jquery-barcode online.

The code is very simple, for example this code (call it index.cfm) generates a barcode from a parameter passed to the page (URL.code) e.g. index.cfm?code=12345

<cfparam name="URL.code" default="12345">

<html>

<head>

<script type="text/javascript" src="jquery-barcode/jquery-1.3.2.min.js"></script>   

<script type="text/javascript" src="jquery-barcode/jquery-barcode.js"></script> 

<script language="JavaScript">

function bc() {

  $('#bcTarget').barcode('<cfoutput>#Trim(URL.code)#</cfoutput>', 'code128', {barHeight:50, barWidth:1, showHRI:true, fontSize: 11});

}

</script>

</head>

<body onLoad="bc();">

<div id="bcTarget" style="font-family: arial; font-weight: bold;"></div>

</body>

</html>

Using client-side code takes the pressure off the server a bit. There are CF barcode generators too, but they invariably end up using third party  things like ActiveX and/or JavaScript, so jQuery-barcode is worth a look.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation