question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Bug? How can I display Hebrew text in a table? doc.text() does it, but doc.table does not

See original GitHub issue

After installing Hebrew fonts, doc.text(…) displays them, whilst doc.table(…) does not. How can I display Hebrew text in a table? I’m attaching the pdf file and here is my example code:

let doc = new jsPDF.jsPDF(); doc.addFont(‘libs/ofek/fonts/David.ttf’, ‘David’, ‘normal’); // this works doc.addFont(‘libs/ofek/fonts/davidbd.ttf’, ‘davidbd’, ‘bold’); // this works doc.setFont(“David”, “normal”); // set font doc.setFontSize(16); let headers; let data; doc.text(Michael Lev, 10, 10); doc.text(“מיכאל לאב”, 10, 20); doc.text(“I am מיכאל לאב”, 10, 30); headers = that.createHeaders([ “field_name”, “field_value” ]); data = [ { field_name: “Michael”, field_value: “Lev” }, { field_name: “מיכאל”, field_value: “לאב” } ]; doc.table(15, 60, data, headers, { autoSize: true }); doc.save(“a4.pdf”);

a4 (34).pdf

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
HackbrettXXXcommented, Dec 24, 2020

That’s odd. I just tested it with different fonts (Batang) and different characters (which should in theory make no difference), and it works. Does this only happen with your specific font? Or only with Hebrew characters? Which jsPDF version do you have?

0reactions
github-actions[bot]commented, Apr 16, 2021

This issue is stale because it has been open 90 days with no activity. It will be closed soon. Please comment/reopen if this issue is still relevant.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bug? How can I display Hebrew text in a table? doc ... - GitHub
I'm attaching the pdf file and here is my example code: let doc = new ... that doc.text() displays Hebrew fonts but do.table()...
Read more >
Some characters missing or cut off when displayed on screen ...
Method 3: Change the Line Spacing. Word 2003, Word 2002, or Word 2000. Select the text and then click Paragraph on the Format...
Read more >
101627 – WW8: hebrew Text following page break not displayed
To test this bug: 1. Open the attached file שיקום4.doc 2. Search for the phrase "סיכום המחקרים"‎. 3. Writer finds the text in...
Read more >
5 Common table problems & its best solution - YouTube
Following are 5 most common problems encountered while working with tables in Ms Word. This video shows how to solve these problems in...
Read more >
Edit & view text from right to left - Google Docs Editors Help
Settings. Click the box next to "Always show right-to-left controls." Click OK. The setting now applies to Google Docs, Sheets, and Slides.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found