PhantomJS PDF输出小于预期

时间:2014-09-09 00:59:09

标签: javascript phantomjs

我有以下PhantomJS脚本:

var page = require('webpage').create();

page.viewportSize = {
    width: screen.width,
    height: screen.height
};

console.log(screen.width);

page.paperSize = {
    width: screen.width,
    height: screen.height
};

page.open('https://www.google.co.id/', function() {
    setTimeout(function() {
        page.render('export.pdf');
        phantom.exit();
    }, 2000);
});

我原本期望PDF输出与我的屏幕尺寸相同,但当我将其缩放到100%时,结果是尺寸更小。 enter image description here

我错过了什么吗?或者这是一个错误? 我从下载页面使用Windows版本1.9.7。

由于

0 个答案:

没有答案
相关问题