简体   繁体   English

用于生成QR码的JavaScript API

[英]javascript API for generating QR codes

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). 我正在寻找一个JavaScript API,用于生成QR码(名称,地址等)并以可打印格式(png / jpeg / pdf)输出。 This seems to me to be something others before must have had a need for. 在我看来,这是其他人之前必不可少的东西。

jquery-qrcode jQuery plugin also generates QR code using HTML5 canvas element or HTML table, if canvas is not supported. 如果不支持canvas,jQuery插件还将使用HTML5 canvas元素或HTML表生成QR码。

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

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

在此处输入图片说明

Working jsFiddle demo: 工作的jsFiddle演示:

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

Google has a QR code generator as part of their Chart Tools that you can use here. Google在其图表工具中有一个QR码生成器,您可以在此处使用。

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

Maksym's solution is better than Google's library because it runs at local does not need to call Google API. Maksym的解决方案比Google的库更好,因为它在本地运行,不需要调用Google API。 also if you don't use jQuery, you can use this one at https://github.com/amanuel/JS-HTML5-QRCode-Generator 如果您不使用jQuery,也可以在https://github.com/amanuel/JS-HTML5-QRCode-Generator上使用它

另一个HTML5解决方案是http://davidshimjs.github.io/qrcodejs/,具有IE6~10, Chrome, Firefox, Safari, Opera, Mobile Safari, Android, Windows Mobile浏览器兼容性

You can use Telerik Kendo-UI to generate qrcode and barcode . 您可以使用Telerik Kendo-UI生成qrcode和条形码 It is easy to use. 这个用起来很简单。

Try using this example code: 尝试使用以下示例代码:

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

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

https://drive.google.com/open?id=0B3TWIbBcUUTwcE1vV24wQnRxNGs 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. 上面是js文件的链接,将其包含在您的项目中,并在Cake php或您要使用的任何位置的ctp文件中编写以下代码。 i tested it in cake php... 我在蛋糕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>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM