Textoutput with ascii not working
Hi Guys,
I would like to work with ASCII and UTF-8 characters in one PDF.
German umpaute (aä, ö, ß, etc.) are displayed correctly.
However, the following code with converted ASCII characters (e.g. to represent a square) does not work:
function run() {
var doc = new jsPDF();
doc.setFontSize(40);
doc.text(35, 25, 'Does this work?');
var res = String.fromCharCode(9633, 9635, 9634, 9711, 9673, 9675);
doc.text(35, 45, res);
doc.save('Testy.pdf');
}
I tried this with jspdf.min (1.0.272, 1.5.3, 2.1.1)
Likewise, some special characters are not displayed correctly and instead pull the text apart. I am attaching a few sample pictures here.
The ASCII characters are displayed correctly in the JavaScript console of the FireFox browser.
Unfortunately not in the PDF.
Further texts are also not correctly shown. I could find out that e.g. ( - ) is disturbing.
String:
Welche Schritte müssen im Rahmen der Verhältnismäßigkeit bei Maßnahmen nach den §§ 9 – 15 UZwGBw geprüft werden? Nennen Sie die drei Schritte!
PDF:
Many other texts are displayed correctly.
Best Regards
See the pinned issue #2677.