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

182
Visualizações
Downloading php page as pdf in Codeigniter not working using JavaScript

I have a Codeigniter website, in it which has a view page and its values are coming from database. I want to download the page as pdf, i tried tcpdf and dompdf, but the issue is css and JavaScript is not working im these libraries. So i tried using jspdf like below:

<button id="cmd">generate PDF</button>
<div class="container" id="content">
..........
</div>

<div id="editor"></div>



var doc = new jsPDF();
        var specialElementHandlers = {
     '#editor': function (element, renderer) {
            return true;
        }
        };

   $('#cmd').click(function () {
          doc.fromHTML($('#content').html(), 15, 15, {
        'width': 170,
    'elementHandlers': specialElementHandlers
    });
     doc.save('sample-file.pdf');
 });

Here the issue is, the pdf is getting downloaded but there is no data shown, a blank pdf is downloaded. Can anyone please tell me whats wrong here. Thanks in advance

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