javascript API for generating QR codes

☆樱花仙子☆ 提交于 2019-12-20 19:56:35

问题


I am looking for a javascript API for generating QR codes (name, address and such) and outputting them in a printable format (png/jpeg/pdf). This seems to me to be something others before must have had a need for.


回答1:


Google has a QR code generator as part of their Chart Tools that you can use here.

http://code.google.com/apis/chart/infographics/docs/qr_codes.html




回答2:


jquery-qrcode jQuery plugin also generates QR code using HTML5 canvas element or HTML table, if canvas is not supported.

https://github.com/jeromeetienne/jquery-qrcode

$('#test').qrcode({
    width: 120,
    height: 120, 
    text: "https://github.com/jeromeetienne/jquery-qrcode"});

Working jsFiddle demo:

http://jsfiddle.net/maxim75/YwN8p/4/




回答3:


Maksym's solution is better than Google's library because it runs at local does not need to call Google API. also if you don't use jQuery, you can use this one at https://github.com/amanuel/JS-HTML5-QRCode-Generator




回答4:


Another HTML5 solution is http://davidshimjs.github.io/qrcodejs/ with IE6~10, Chrome, Firefox, Safari, Opera, Mobile Safari, Android, Windows Mobile browser compatibility




回答5:


You can use Telerik Kendo-UI to generate qrcode and barcode. It is easy to use.

Try using this example code:

QR Code: https://demos.telerik.com/kendo-ui/qrcode/index

Barcode: https://demos.telerik.com/kendo-ui/barcode/index




回答6:


https://drive.google.com/open?id=0B3TWIbBcUUTwcE1vV24wQnRxNGs

above is the link of js file include it in your project and write the below code in ctp file in cake php or any where you want to use. i tested it in cake php...

<-- including the file....
<?php echo $this->Html->script('jquery.qrcode.min.js')?>
<div style='padding:100px''><img id="demo" style='width: 100px,height: 100px'></div>
<script type="text/javascript">jQuery("#demo").qrcode({text: "HEllo World!"});</script>


来源:https://stackoverflow.com/questions/7196798/javascript-api-for-generating-qr-codes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!