persian language propblem
Hi I'm going to convert html to pdf. I used jsPDF for this. But it did not support persian language. So i found that i should first convert html to canvas and then add canvas to pdf file.
So my problem is that html2canvas change font and unicode. I'm using last version (html2canvas 1.0.0-alpha.10)
My Code is
html2canvas(thisObject.Options.target, { onrendered: function (canvas) { theCanvas = canvas;
document.body.appendChild(canvas);
canvas.toBlob(function (blob) {
saveAs(blob, "Dashboard.png");
});
}
});
And output:

hi, use "word-break: normal;" in div css style
In my case it was letter-spacing which wasn't set to 0.
const screenshot = await html2canvas(document.getElementById('receip')!, {
foreignObjectRendering: true,
width: width,
height: height,
})
screenshot.toBlob((res) => {
if (res) {
const receip = new File([res], 'reciep.png', { type: res.type })
navigator.share({ files: [receip] })
}
})``
In my case it was
letter-spacingwhich wasn't set to0.
this way work for me