jsPDF icon indicating copy to clipboard operation
jsPDF copied to clipboard

HTML to PDF - not 2nd page is added

Open KRav007 opened this issue 11 years ago • 5 comments

Hi there, I'm wondering, why me pdf has only one page. My text is cutted off. In the demo it seems, that the script add automatic an new page to the pdf if needed.

Thanks for your help

KRav007 avatar Mar 09 '15 08:03 KRav007

           var doc = new jsPDF('p');   // p means potrait , u can use landscape mode too
            doc.setFontSize(10);
            doc.setFont("times");
            doc.text(5, 10, "your data here");
           doc.save("test.pdf");

use this jspdf script : https://github.com/MrRio/jsPDF/blob/master/jspdf.js

By using this we can generate multiple page pdf.

sureshmuttagi avatar Mar 11 '15 12:03 sureshmuttagi

thanks but, I need an automatic page break, cause I have a long html pages that should be converted into a pdf

KRav007 avatar Mar 11 '15 13:03 KRav007

It breaks the long text into pages while generating pdf automatically.

sureshmuttagi avatar Mar 12 '15 04:03 sureshmuttagi

this breaks nothing: pdf.fromHTML( );

if I put my html into the text method I loose the css!

KRav007 avatar Mar 12 '15 17:03 KRav007

fixed in latest version

KRav007 avatar Mar 25 '15 22:03 KRav007