我正在jspdf中创建一个div大小的矩形边框,但问题是矩形仅在生成的pdf的单个页面上创建
var pdf = new jsPDF('p', 'pt', 'a4');
var source = $('#content')[0];
specialElementHandlers = {
'#bypassme': function (element, renderer) {
return true
}
};
margins = {
top: 30,
bottom: 30,
left: 30,
width: 534,
};
pdf.fromHTML(
source, // HTML string or DOM elem ref.
margins.left, // x coord
margins.top, { // y coord
'width': margins.width, // max width of content on PDF
'elementHandlers': specialElementHandlers
},
function (dispose) {
pdf.setLineWidth(2);
pdf.rect(15, 15, 565, 815);
pdf.save('download.pdf');
}, margins);