update phanomjs pdf printing to work with latest pdf css

This commit is contained in:
Hakim El Hattab 2013-06-18 21:55:01 -04:00
parent 789a196e8f
commit 7e8ee5340e
1 changed files with 8 additions and 3 deletions

View File

@ -11,8 +11,13 @@
var page = new WebPage(); var page = new WebPage();
var system = require( 'system' ); var system = require( 'system' );
page.viewportSize = {
width: 1024,
height: 768
};
page.paperSize = { page.paperSize = {
format: 'A4', format: 'letter',
orientation: 'landscape', orientation: 'landscape',
margin: { margin: {
left: '0', left: '0',
@ -21,7 +26,6 @@ page.paperSize = {
bottom: '0' bottom: '0'
} }
}; };
page.zoomFactor = 1.5;
var revealFile = system.args[1] || 'index.html?print-pdf'; var revealFile = system.args[1] || 'index.html?print-pdf';
var slideFile = system.args[2] || 'slides.pdf'; var slideFile = system.args[2] || 'slides.pdf';
@ -36,4 +40,5 @@ page.open( revealFile, function( status ) {
console.log( 'Printed succesfully' ); console.log( 'Printed succesfully' );
page.render( slideFile ); page.render( slideFile );
phantom.exit(); phantom.exit();
} ); } );