blob: c22264ca1e9190d71b5a334a055f9e0e0ed37954 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
// 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.length - 4 != slideFile.lastIndexOf('.pdf')) {
slideFile += '.pdf';
}
page.open(revealFile, function (status) {
page.render(slideFile);
phantom.exit();
});
|