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.
HTML:
JavaScript
x
4
1
<div id="wrapper">
2
<span>این کاراکتر ها بهم میریزند</span>
3
</div>
4
JavaScript:
JavaScript
1
14
14
1
$(document).ready(function() {
2
html2canvas($("#wrapper"), {
3
onrendered: function (canvas) {
4
theCanvas = canvas;
5
6
document.body.appendChild(canvas);
7
8
canvas.toBlob(function (blob) {
9
saveAs(blob, "Dashboard.png");
10
});
11
}
12
});
13
});
14
WebPage:
Captured WebPage via html2canvas:
you can see full example here
What is wrong with my implementation?
Advertisement
Answer
Set the box css that have trouble to :
JavaScript
1
2
1
text-align: left; //or right or justify
2
that work for me.