javascript API for generating QR codes

2019-03-19 21:46发布

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.

5条回答
何必那么认真
2楼-- · 2019-03-19 22:26

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>
查看更多
【Aperson】
3楼-- · 2019-03-19 22:27

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楼-- · 2019-03-19 22:32

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

查看更多
爷、活的狠高调
5楼-- · 2019-03-19 22:35

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

查看更多
Fickle 薄情
6楼-- · 2019-03-19 22:47

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"});

enter image description here

Working jsFiddle demo:

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

查看更多
登录 后发表回答