Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generate pdf reports in Hebrew

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.

like image 882
user11794183 Avatar asked Oct 15 '25 14:10

user11794183


1 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.

like image 105
Liel Amrami Avatar answered Oct 18 '25 06:10

Liel Amrami



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!