Javascript – Html2canvas image capturing issue with UTF-8 characters


I want to capture my webpage, In order to this I find html2canvas, when I use as shown below ,my UTF-8 (persian) characters get in trouble and this direction destroyed as you see.


   <div id="wrapper">
        <span>این کاراکتر ها بهم میریزند</span>


$(document).ready(function() {
    html2canvas($("#wrapper"), {
        onrendered: function (canvas) {
            theCanvas = canvas;


            canvas.toBlob(function (blob) {
                saveAs(blob, "Dashboard.png");


enter image description here

Captured WebPage via html2canvas:

enter image description here

you can see full example here

What is wrong with my implementation?

Best Solution

This is a bug with html2canvas (Arabic Encoding with html2canvas) and can be fixed by setting text-align: left on your wrapper element.

Here's an updated fiddle