{"id":1699,"date":"2018-12-27T14:36:34","date_gmt":"2018-12-27T14:36:34","guid":{"rendered":"https:\/\/azoora.com\/blog\/?p=1699"},"modified":"2019-06-01T19:00:32","modified_gmt":"2019-06-01T19:00:32","slug":"easyqrcodejs-qr-code-generator-with-logo-title-support","status":"publish","type":"post","link":"https:\/\/azoora.com\/blog\/javascript\/easyqrcodejs-qr-code-generator-with-logo-title-support\/","title":{"rendered":"EasyQRCodeJS: QR Code Generator with Logo &#038; Title Support"},"content":{"rendered":"\n<h3>Description:<\/h3>\n\n\n\n<p>EasyQRCodeJS is a cross-browser, client-side&nbsp;QR code generator&nbsp;that supports custom logo and title.<\/p>\n\n\n\n<p>Based on JavaScript, HTML5 canvas and HTML table. Heavily based on the&nbsp;<a href=\"https:\/\/github.com\/davidshimjs\/qrcodejs\" target=\"_blank\" rel=\"noreferrer noopener\">qrcodejs<\/a>&nbsp;library.<\/p>\n\n\n\n<!--more-->\n\n\n\n<h3>How to use it:<\/h3>\n\n\n\n<p>Install &amp; download.<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>1<\/code><\/td><td><code># NPM<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>2<\/code><\/td><td><code>$ npm install easyqrcodejs --save<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Import the&nbsp;EasyQRCodeJS into the HTML document.<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>1<\/code><\/td><td><code>&lt;<\/code><code>script<\/code>&nbsp;<code>src<\/code><code>=<\/code><code>\"easy.qrcode.js\"<\/code><code>&gt;&lt;\/<\/code><code>script<\/code><code>&gt;<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Create a container in which you want to place the QR code.<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>1<\/code><\/td><td><code>&lt;<\/code><code>div<\/code>&nbsp;<code>id<\/code><code>=<\/code><code>\"qrcode\"<\/code><code>&gt;&lt;\/<\/code><code>div<\/code><code>&gt;<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Generate a basic QR code.<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>1<\/code><\/td><td><code>var<\/code>&nbsp;<code>qrcode =&nbsp;<\/code><code>new<\/code>&nbsp;<code>QRCode(document.getElementById(<\/code><code>\"qrcode\"<\/code><code>), {<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>2<\/code><\/td><td><code>text:&nbsp;\"<a href=\"https:\/\/www.github.com\/\">https:\/\/www.github.com<\/a>\"<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>3<\/code><\/td><td><code>});<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Add a custom logo to the QR code.<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>1<\/code><\/td><td><code>var<\/code>&nbsp;<code>qrcode =&nbsp;<\/code><code>new<\/code>&nbsp;<code>QRCode(document.getElementById(<\/code><code>\"qrcode\"<\/code><code>), {<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>2<\/code><\/td><td><code>text:&nbsp;<\/code><code>\"<a href=\"https:\/\/www.cssscript.com\/\">https:\/\/www.cssscript.com<\/a>\"<\/code><code>,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>3<\/code><\/td><td><code>logo:&nbsp;<\/code><code>\"logo.png\"<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>4<\/code><\/td><td><code>});<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Add custom title and subtitle to the QR code.<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>01<\/code><\/td><td><code>var<\/code>&nbsp;<code>qrcode =&nbsp;<\/code><code>new<\/code>&nbsp;<code>QRCode(document.getElementById(<\/code><code>\"qrcode\"<\/code><code>), {<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>02<\/code><\/td><td><code>title:&nbsp;<\/code><code>'QR Title'<\/code><code>,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>03<\/code><\/td><td><code>titleFont:&nbsp;<\/code><code>\"bold 18px Arial\"<\/code><code>,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>04<\/code><\/td><td><code>titleColor:&nbsp;<\/code><code>\"#004284\"<\/code><code>,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>05<\/code><\/td><td><code>titleBgColor:&nbsp;<\/code><code>\"#fff\"<\/code><code>,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>06<\/code><\/td><td><code>titleHeight: 70,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>07<\/code><\/td><td><code>titleTop: 25,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>08<\/code><\/td><td><code>subTitle:&nbsp;<\/code><code>'QR subTitle'<\/code><code>,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>09<\/code><\/td><td><code>subTitleFont:&nbsp;<\/code><code>\"14px Arial\"<\/code><code>,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>10<\/code><\/td><td><code>subTitleColor:&nbsp;<\/code><code>\"#004284\"<\/code><code>,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>11<\/code><\/td><td><code>subTitleTop: 40<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>12<\/code><\/td><td><code>});<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Customize the appearance of the QR code.<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>1<\/code><\/td><td><code>var<\/code>&nbsp;<code>qrcode =&nbsp;<\/code><code>new<\/code>&nbsp;<code>QRCode(document.getElementById(<\/code><code>\"qrcode\"<\/code><code>), {<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>2<\/code><\/td><td><code>width: 256,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>3<\/code><\/td><td><code>height: 256,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>4<\/code><\/td><td><code>colorDark :&nbsp;<\/code><code>\"#000000\"<\/code><code>,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>5<\/code><\/td><td><code>colorLight :&nbsp;<\/code><code>\"#ffffff\"<\/code><code>,<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>6<\/code><\/td><td><code>correctLevel : QRCode.CorrectLevel.H<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>7<\/code><\/td><td><code>});<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Remove the QR code.<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>1<\/code><\/td><td><code>qrcode.clear();<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<p>Re-generate a new QR code.<\/p>\n\n\n\n<table class=\"wp-block-table\"><tbody><tr><td><code>1<\/code><\/td><td><code>qrcode.makeCode(<\/code><code>\"New Content Here\"<\/code><code>);<\/code><\/td><\/tr><\/tbody><\/table>\n\n\n\n<blockquote class=\"wp-block-quote\"><p><strong>Author<\/strong>: ushelp<\/p><p><strong>License<\/strong>: MIT<\/p><p><strong>Demo<\/strong>: <a href=\"https:\/\/www.cssscript.com\/demo\/qr-code-generator-logo-title\">Link<\/a><\/p><p><strong>Download<\/strong>: <a href=\"https:\/\/github.com\/ushelp\/EasyQRCodeJS\/archive\/master.zip\">Github<\/a><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Description: EasyQRCodeJS is a cross-browser, client-side&nbsp;QR code generator&nbsp;that supports custom logo and title. Based on JavaScript, HTML5 canvas and HTML table. Heavily based on the&nbsp;qrcodejs&nbsp;library.<\/p>\n","protected":false},"author":2,"featured_media":1700,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false},"categories":[12],"tags":[87],"jetpack_featured_media_url":"https:\/\/azoora.com\/blog\/wp-content\/uploads\/2019\/03\/qr-code-generator-logo-title.png","jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p7FQPL-rp","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts\/1699"}],"collection":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/comments?post=1699"}],"version-history":[{"count":2,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts\/1699\/revisions"}],"predecessor-version":[{"id":1703,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/posts\/1699\/revisions\/1703"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/media\/1700"}],"wp:attachment":[{"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/media?parent=1699"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/categories?post=1699"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/azoora.com\/blog\/wp-json\/wp\/v2\/tags?post=1699"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}