【发布时间】:2023-03-18 22:00:01
【问题描述】:
我正在使用 phantomjs 来呈现带有页眉和页脚的 pdf。在所有页面中都实现了添加页眉和页脚。有没有办法单独从第一页删除页眉/页脚?
header: {
height: "1cm",
contents: phantom.callback(function(pageNum, numPages) {
return "<h1>Header <span style='float:right'>" + pageNum + " / " + numPages + "</span></h1>";
})}, footer: {
height: "1cm",
contents: phantom.callback(function(pageNum, numPages) {
return "<h1>Footer <span style='float:right'>" + pageNum + " / " + numPages + "</span></h1>";
})}
【问题讨论】: