Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!