简体   繁体   English

无法从PhantomJs render命令获取整个png

[英]Can't get entire png from PhantomJs render command

I am using PhantomJS for converting html file into png . 我正在使用PhantomJShtml file into png Actually, my html file is bit lengthier in horizontal way. 实际上,我的html文件在水平方向上有点长。 PhantomJs do not capture its image entire up to last horizontal scroll.I'm using render command for converting html into png.What exactly I am missing or is there any limitation phantomJS has ? PhantomJs不能捕获到最后一个水平滚动的整个图像。我正在使用render命令将html转换为png。我到底缺少什么,phantomJS有什么限制?

Did you set an appropiate window size (viewport)? 您是否设置了适当的窗口大小(视口)? From this example : 从这个例子

var page = require('webpage').create();
page.viewportSize = { width: 320, height: 480 }; // <============
page.open('http://news.google.com/news/i/section?&topic=t', function (status) {
 ...

PhantomJs问题博客发布答案https://github.com/ariya/phantomjs/issues/12950

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM