Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

181
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda