Sha256: f867a243917c1681330e73c8c7321976fbc00ed431eca65790da08cee9c920d4

Contents?: true

Size: 830 Bytes

Versions: 55

Compression:

Stored size: 830 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.viewportSize  = {
	width: 1024,
	height: 768
};

page.paperSize = {
	format: 'letter',
	orientation: 'landscape',
	margin: {
		left: '0',
		right: '0',
		top: '0',
		bottom: '0'
	}
};

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

55 entries across 53 versions & 6 rubygems

Version Path
slippery-0.1.0 assets/reveal.js/plugin/print-pdf/print-pdf.js
slippery-0.0.3 assets/reveal.js/plugin/print-pdf/print-pdf.js
hyla-1.0.3 lib/resources/revealjs/plugin/print-pdf/print-pdf.js
hyla-1.0.2 lib/resources/revealjs/plugin/print-pdf/print-pdf.js
hyla-1.0.1 lib/resources/revealjs/plugin/print-pdf/print-pdf.js
reveal-ck-0.2.0 reveal.js/plugin/print-pdf/print-pdf.js
slide_hero-0.0.3 vendor/reveal.js/plugin/print-pdf/print-pdf.js
reveal-ck-0.1.8 reveal.js/plugin/print-pdf/print-pdf.js
slippery-0.0.1 assets/reveal.js/plugin/print-pdf/print-pdf.js
slide_hero-0.0.2 vendor/reveal.js/plugin/print-pdf/print-pdf.js
reveal-ck-0.1.7 reveal.js/plugin/print-pdf/print-pdf.js
reveal-ck-0.1.6 reveal.js/plugin/print-pdf/print-pdf.js
reveal-ck-0.1.5 reveal.js/plugin/print-pdf/print-pdf.js
reveal-ck-0.1.4 reveal.js/plugin/print-pdf/print-pdf.js
reveal-ck-0.1.3 reveal.js/plugin/print-pdf/print-pdf.js