Coldfusion CFML QR-Code Generator - Write QRCode to a file with less effort
- Add ZXing QRCode libraries:
lib/zxing-3.5.0-core.jar
lib/zxing-3.5.0-javase.jar
- Put JAR files in
lib
folder on your CFML EngineCLASSPATH
- Coldfusion: <CFPATH>
/runtime/lib
- Railo: <CFProject>
/WEB-INF/railo/lib
- Lucee: <CFProject>
/WEB-INF/lib
- Coldfusion: <CFPATH>
- Add the CFC set to your project
src/info/jlepage/Barcode.cfc
src/info/jlepage/QRCode.cfc
src/info/jlepage/ZXing.cfc
- Play with it!
CFML Sample:
<cfset qrCode = new info.jlepage.QRCode() />
<cfset qrCode.setData("Hello World!") />
<cfset qrCode.writeToFile("myQRCode.png") />
CFScript Sample:
<cfscript>
qrCode = new info.jlepage.QRCode();
qrCode.setData("Hello World!");
qrCode.writeToFile("myQRCode.png");
</cfscript>
CFScript direct image binary:
<cfscript>
qrCode = new info.jlepage.QRCode();
qrCode.setData("Hello World!");
imageBinary = qrCode.readBinary();
</cfscript>
Can be more easy? 😃
More samples in:
src/index.cfm
src/barcode.cfm
Please visite the ZXing project at:
https://github.com/zxing/zxing
ZXING is under Apache License 2.0
http://www.apache.org/licenses/LICENSE-2.0
https://github.com/zxing/zxing/blob/master/LICENSE
Copyright (c) 2013, Jerome Lepage http://www.jlepage.info
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License
http://creativecommons.org/licenses/by-sa/3.0/
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.