0

I would create a PDF-Document with a table and it works, but the table is to long for one page, how can I 'cut' the table in two? Means the first 60 rows of table on page one and the next 100 on page two. The code (reduced):

function createDoc() { [...] pdf.addHTML(document.getElementById('svg_graph'), 20, 110, function () { pdf.addPage(); pdf.addHTML(document.getElementById('table'), 40, 40, function () { pdf.save('AjaxReport-' + curNum + '.pdf'); }); }); }; 

curNum is a string.

1 Answer 1

1

You can use the "pagesplit" option and new pages will be automatically added as needed.

Taking your example, it'd be:

function createDoc() { [...] var options = { pagesplit : true }; pdf.addHTML(document.getElementById('svg_graph'), 20, 110, function () { pdf.addPage(); pdf.addHTML(document.getElementById('table'), 40, 40, options, function () { pdf.save('AjaxReport-' + curNum + '.pdf'); }); }); }); }; 
Sign up to request clarification or add additional context in comments.

2 Comments

Thanks. Now it's divided into several pages, but the quality of the writing has reduced and it's hardly readable. Do you have an idea how I can manage this?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.