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

110
Visualizações
HTML2PDF returning blank PDF

One of our clients' sites uses a tool called HTML2PDF, which, as you might have guessed from its name, converts HTML to PDF using js. It was very easy to implement and worked fine, until now. It now shoots out a PDF that's completely blank. There are no errors in the console, and the script seems to run through without stopping (the developer added a few console logs here and there). A console log on the HTML element we're feeding the html2pdf function returns normally - (a block of html, as expected).

Here's the HTML2PDF project: https://github.com/eKoopmans/html2pdf.js

The script that calls html2pdf:

jQuery('.js-download-itinerary-file').on('click', function(e){
  e.preventDefault();

  var element = jQuery('.pdf-container');

  var opt = {
        filename: 'download.pdf',
  };

  html2pdf().set(opt).from(element[0]).save();
});

I'm looking for a way to troubleshoot, or maybe an alternative... If anyone knows what might be going on, even better!

Any advice helps :)

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