I have tried all the react pdf generators to support Hebrew text. I successfully built the whole reporting system with pdfmake, but then I came to realize it doesn’t support Hebrew ( rtl ). I tried to change the fonts by looking on few solutions. Somebody please specify some package that can support Hebrew in a proper way. I don’t know how to add fonts to any of the packages.
-
1Yes, I have been looking for the same answer. – Osama Khalid Jul 16 '19 at 20:14
-
maybe this will assist? https://stackoverflow.com/questions/49154335/html-to-pdf-using-jspdf-rtl-support – A. Meshu Jul 16 '19 at 20:51
2 Answers
I am using react-pdf
I had the same problem - Hebrew was gibberish. Solved it by adding and using Rubik font.
In react-pdf it's pretty easy to add a font:
Font.register({
family: 'Rubik',
src: '/fonts/Rubik-Regular.ttf'
});
I also tried pdfmake but eventually chose react-pdf because it has better documentation and it had everything I needed.

- 521
- 5
- 20

- 31
- 3
It helped me with Hebrew in react-pdf/renderer, but in PDF if hebrew has unicode symbols text is broken .
Font.register({ family: 'Rubik', src: "http://fonts.gstatic.com/s/rubik/v3/4sMyW_teKWHB3K8Hm-Il6A.ttf" });
It works in my app . But doesn't work if substitute in https://react-pdf.org/repl?example=page-wrap .Look for "Rubik" in this file (Ctrl + F and insert Rubik in search input): https://gist.github.com/karimnaaji/b6c9c9e819204113e9cabf290d580551, all fonts related to Rubik contain Hebrew characters .

- 11
- 2