In generating PDFs in Phantom, I can set the paper size like this:
page.paperSize = {
height: '8.5in',
width: '11in',
orientation: 'landscape',
border: '0.4in'
};
then the page.render(output) function generates a PDF properly. In other words, the size is correct and it has many pages of that size.
I can't get this to work in Casper (and I'm not sure if it is supported). So for example, the following:
var casper = require('casper').create({
paperSize: {
height: '8.5in',
width: '11in',
orientation: 'landscape',
border: '0.4in'
},
logLevel: 'debug',
verbose: true
});
....this.capture('print.pdf'); ...
creates a PDF with a single, very long page. Setting viewportSize does not fix the problem.
Is there any way to access the pageSize object from within Casperjs?