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.