Convert JQuery QR Code to Image using JS <p>I was wondering how it's possible to download the JQuery generated QR code or convert to a downloadable image (png/jpeg) using javascript.</p> <p>I tried what was here: <a href="http://stackoverflow.com/questions/923885/capture-html-canvas-as-gif-jpg-png-pdf">Capture HTML Canvas as gif/jpg/png/pdf?</a> But no success. I think it's related to the output. There is a table and canvas output, but both do not give the image data...</p> <p>Here is my code:</p> <pre><code>&lt;script src="js/jquery-1.3.2.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/jquery.qrcode.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="js/qrcode.js"&gt;&lt;/script&gt; &lt;div id="output"&gt;&lt;/div&gt; &lt;script&gt; jQuery(function(){ jQuery('#output').qrcode("http://"); }) var canvas = document.getElementById("output"); var img = canvas.toDataURL("image/png"); document.write('&lt;img src="'+img+'"/&gt;'); &lt;/script&gt; </code></pre> <p>Also I was hoping to surround the QR Code with a white background (Adding rows and columns within the div) before converting to image to aid the detection (so that the background is also included in the image). </p> <p>Any help is appreciated...</p>