Dynamic page adding through jsPdf
- by Vishakh Shetty
I am trying to convert content from tinymce editor to pdf using Jspdf.
But as JSpdf creating single pdf page only initial 30 lines from editors appering in PDF.. So how can I add page dynamically to convert whole content to pdf??
My CODE:
function save_to_pdf() {
var myIFrame = document.getElementById(text_ifr);
var content = myIFrame.contentWindow.document.body.innerHTML;
$('#pdf_text').html(content);
var pdf = new jsPDF('p', ' in ', 'letter'),
source = $('#pdf_text')[0],
specialElementHandlers = {
'#bypassme': function(element, renderer) {
return true;
}
};
pdf.fromHTML(
source, // HTML string or DOM elem ref.
0.5, // x coord
0.5, // y coord
{
width: 7.5, // max width of content on PDF
elementHandlers: specialElementHandlers
}
);
pdf.addImage(imageData, JPEG, 95, 5, 20, 20);
pdf.save(Test.pdf);
}
Thanks in Advance