How to make transparent color white instead of black in html2canvas?

I modified temporary: _html2canvas.Util.isTransparent from _html2canvas.Util.isTransparent = function(backgroundColor) { return (backgroundColor === “transparent” || backgroundColor === “rgba(0, 0, 0, 0)”); }; to _html2canvas.Util.isTransparent = function(backgroundColor) { return (backgroundColor === “transparent” || backgroundColor === “rgba(0, 0, 0, 0)” || backgroundColor === undefined); }; and after that it was enough to call html2canvas with background parameter set: … Read more

create screenshot of webpage using html2canvas (unable to initialize properly)

You should use it this way: $(‘body’).html2canvas(); var queue = html2canvas.Parse(); var canvas = html2canvas.Renderer(queue,{elements:{length:1}}); var img = canvas.toDataURL(); window.open(img); It took me few hours to figure it out, how to use it the right way. The {elements:{length:1}} is required, due to incomplete implementation of the plugin, otherwise you’ll get an error. Good luck!

How to save img to user’s local computer using HTML2canvas

NOTE: this answer is from 2015 and the library has been updated. Check the answers below for alternate implementations. Try this (Note that it makes use of the download attribute. See the caniuse support table for browsers that support the download attribute) <script> $(‘#save_image_locally’).click(function(){ html2canvas($(‘#imagesave’), { onrendered: function (canvas) { var a = document.createElement(‘a’); // … Read more

HTML2canvas generates Blurry images

you can use scale options in html2canvas. In the latest release, v1.0.0-alpha.1, you can use the scale option to increase the resolution (scale: 2 will double the resolution from the default 96dpi). // Create a canvas with double-resolution. html2canvas(element, { scale: 2, onrendered: myRenderFunction }); // Create a canvas with 144 dpi (1.5x resolution). html2canvas(element, … Read more