Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

174
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda