Sha256: c8ac858c7d38e6140f6cdcc88702b54277a41fae35c1e2a1c667e14569a9e84e
Contents?: true
Size: 793 Bytes
Versions: 3
Compression:
Stored size: 793 Bytes
Contents
/** * phantomjs script for printing presentations to PDF. * * Example: * phantomjs print-pdf.js "http://lab.hakim.se/reveal-js?print-pdf" reveal-demo.pdf * * By Manuel Bieh (https://github.com/manuelbieh) */ // html2pdf.js var page = new WebPage(); var system = require( 'system' ); page.paperSize = { format: 'A4', orientation: 'landscape', margin: { left: '0', right: '0', top: '0', bottom: '0' } }; page.zoomFactor = 1.5; var revealFile = system.args[1] || 'index.html?print-pdf'; var slideFile = system.args[2] || 'slides.pdf'; if( slideFile.match( /\.pdf$/gi ) === null ) { slideFile += '.pdf'; } console.log( 'Printing PDF...' ); page.open( revealFile, function( status ) { console.log( 'Printed succesfully' ); page.render( slideFile ); phantom.exit(); } );
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
reveal-ck-0.1.2 | reveal.js/plugin/print-pdf/print-pdf.js |
reveal-ck-0.1.1 | reveal.js/plugin/print-pdf/print-pdf.js |
reveal-ck-0.1.0 | reveal.js/plugin/print-pdf/print-pdf.js |