问题
I'm using jsPDF for generation of document from HTML (with using .html()
method) and it works fine. But now I need to do next:
- Create jsPDF object.
- Add content with using
.html()
method. - Add new page to created document.
- Add content to second page with using the same
.html()
method. - Save created document.
Here is the code example:
var doc = new jsPDF({ orientation: 'p', format: 'a4' });
doc.html(document.getElementById('test'), {
callback: function (doc) {
doc.addPage('a4', 'p');
doc.html(document.getElementById('test'), {
callback: function (doc) {
doc.output('dataurlnewwindow');
}
}
}
Problem is the second page is always blank. The idea is to create two separate documents with using .html()
method and then merge this two document into one and save it.
So question is - is it possible in jsPDF to merge two documents into one and save it then?
Thanks in advance!
来源:https://stackoverflow.com/questions/56133670/merge-two-pdfs-generated-with-jspdf-into-one-document