我正在使用 jspdf 保存 PDF。我的 HTML 中有表格并且表格没有标题。但是 JsPDF 的功能是在每一页上自动重复表格的第一行并且它们重叠。我不想每个新页面上的标题。有什么办法可以做到这一点。附上 page 的屏幕截图。提前致谢!!!
$scope.SavePage = function() {
var doc = new jsPDF('p', 'pt', 'a4', true);
margins = {
top: 200,
bottom: 60,
left: 40,
width: 522
};
specialElementHandlers = {
'#ignoreComponent': function(element, renderer) {
return true
},
'#ignorePage': function(element, renderer) {
return true
}
};
var source = $('#pageInformationPdf')[0];
doc.fromHTML(source, margins.left, margins.top, {
'width': margins.width,
'pagesplit': true,
'elementHandlers': specialElementHandlers
},
function(dispose) {
doc.save(pageName + '.pdf');
}, margins);
}
最佳答案
在较新的版本 (3.x.x) 中,您可以使用 willDrawCell
Hook 。
例如只是为了隐藏标题(可以应用附加逻辑):
willDrawCell (HookData) {
if (HookData.section === 'head') {
return false
}
},
关于javascript - JsPDF 在每个新页面上重复第一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52779903/