Has anyone gotten the "Open Source QR Code Library" to work with ColdFusion? I need to generate QR Codes in ColdFusion.
I also found this tutorial on how to generate it using Zxing.
But the tutorial is not clear on how to configure the files, e.g. what needs to be in which dir...
Any help and alternatives are welcomed, thanks.
Zxing uses two (2) jars: core.jar
and javase.jar
. The easiest way to install them is to place both jars anywhere in the CF classpath (example: C:\ColdFusion8\wwwroot\web-inf\lib). Then restart the CF server. That is it.
Note: You can either compile the zxing jars yourself or download a slightly older version from this handy entry on blog.getRailo.com) Update: The barcode_samples.zip file does contain sample CF code. But it is for Railo only. Adobe CF does not support the extra parameters for createObject("java"). To use the code in Adobe CF, you need to remove the extra parameters.
<!--- Railo syntax --->
<cfset object = createObject('java','path.to.classtoinvoke','/path/to/jar/file/on/system')>
<!--- Adobe CF --->
<cfset object = createObject('java','path.to.classtoinvoke')>
If you do not have access to the classpath, you can use the JavaLoader.cfc to load the two (2) zxing jars instead. Just download the project. It includes some pretty good examples on installation and usage. But if you have further questions, let me know.