【发布时间】:2013-05-19 05:40:14
【问题描述】:
在 Phantom 中生成 PDF 时,我可以这样设置纸张大小:
page.paperSize = {
height: '8.5in',
width: '11in',
orientation: 'landscape',
border: '0.4in'
};
然后 page.render(output) 函数会正确生成 PDF。换句话说,大小是正确的,并且它有很多页面。
我无法让它在 Casper 中工作(我不确定它是否受支持)。例如,以下内容:
var casper = require('casper').create({
paperSize: {
height: '8.5in',
width: '11in',
orientation: 'landscape',
border: '0.4in'
},
logLevel: 'debug',
verbose: true
});
....this.capture('print.pdf'); ...
创建一个包含一个非常长的页面的 PDF。设置 viewportSize 并不能解决问题。
有没有办法从 Casperjs 中访问 pageSize 对象?
【问题讨论】:
标签: casperjs