0

Can you please help me with a way to download pdf from an HTML string which also has style in it. I am showing the HTML string with 'window.document.write' and opening it in a new tab. so it has no URL or there is no option like save as pdf.
I have tried using jsPDF.

        var doc = new jsPDF('l', 'pt', 'a4');
        var options = {
            pagesplit: true
        };

        doc.addHTML(this.html, 0, 0, options, function () {
            doc.save('test.pdf');
        });

but it gives me error like

enter image description here

here my HTML string is quite big, with tables, rows columns, and also style in it. I have also looked for some other libraries. But found nothing that does the job. It would be really appreciable if you can show me a right way.

Anurag
  • 482
  • 6
  • 23

0 Answers0