Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Textoutput with ascii not working #2708

Closed
tschero opened this issue Mar 26, 2020 · 1 comment
Closed

Textoutput with ascii not working #2708

tschero opened this issue Mar 26, 2020 · 1 comment

Comments

@tschero
Copy link

tschero commented Mar 26, 2020

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'); }

jsbin_not_ok
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.
js_console_ok

Unfortunately not in the PDF.

ascii_not_ok

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:
text_not_ok

Many other texts are displayed correctly.
text_ok

Best Regards

@HackbrettXXX
Copy link
Collaborator

See the pinned issue #2677.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants