Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

176
Views
creating pdf with jsPDF doesn't work right in a foreign language

I'm trying to create a pdf with jsPDF and it works great when the text inside the PDF file is in English. The problem is that I'm creating this for a Hebrew website, and for some reason the text inside the pdf becomes a weird string with some weird letters that have nothing to do with Hebrew.

From searching online I understand that this happens in many foreign languages, but I haven't found a solution yet.

 const word= 'עברית'; //random word in hebrew
    
   const generatePDF = () => {
        const pdf = new jsPDF('example', 'px', 'a4', 'false');
        pdf.text(60, 60, word);
        pdf.save('example.pdf'); //instead of print the word 'עברית' it prints 'âÑèÙê'
    };
generatePDF();

I did some searching and I think that a possible solution has something to do with conversions from cp1255 to UTF-8, but I don't know if it's the right direction and haven't managed to find a real solution yet.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!