使用ColdFusion创建QR代码 [英] Creating QR Code with Coldfusion

查看:189
本文介绍了使用ColdFusion创建QR代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人获得开源QR码库来使用ColdFusion?我需要在ColdFusion中生成QR码。



我还发现本教程,了解如何使用 Zxing 生成它。 p>

但是教程不清楚如何配置文件,例如



欢迎任何帮助和替代方案。解决方案

Zxing使用两个jar: core.jar javase.jar 。安装它们最简单的方法是将两个jar放在CF类路径中的任何位置(例如:C:\ColdFusion8\wwwroot\web-inf \lib)。然后重新启动CF服务器。这就对了。



注意:您可以自行编译zxing jar或从blog.getRailo.com 更新: * barcode_samples.zip *文件包含示例CF代码。但它只是为了Railo。 Adobe CF不支持 createObject(java)的其他参数。要在Adobe CF中使用代码,您需要删除额外的参数。

 <!--- Railo语法---> 
< cfset object = createObject('java','path.to.classtoinvoke','/ path / to / jar / file / on / system')>
<!--- Adob​​e CF --->
< cfset object = createObject('java','path.to.classtoinvoke')>

如果您无法访问类路径,可以使用JavaLoader.cfc 加载两个(2)zxing jar。只需下载项目。它包括一些很好的安装和使用示例。但如果您还有其他问题,请告诉我们。


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.

这篇关于使用ColdFusion创建QR代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆