Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

建议添加图片质量和默认背景色 #9

Open
skyhacker2 opened this Issue · 5 comments

2 participants

@skyhacker2
Collaborator

截取淘宝的时候会出现透明的背景。
添加默认白色背景
page.evaluate(function() {
document.body.bgColor = 'white';
});

增加截图的质量
page.render(imagePath, {quality: 80});

@miniflycn
Owner

good!

@miniflycn miniflycn closed this
@miniflycn
Owner

如果网页背景不是白色的会怎么样呢?
或许我们有两个方案可以做:

  • html标签上加背景色(不规范)
  • 判断当前body背景色然后在选择是否替换成白色。
@miniflycn miniflycn reopened this
@miniflycn
Owner

现在你应该能自行merge了。

@skyhacker2
Collaborator

网页如果设置了背景颜色应该会替换phantomjs初始的吧。我在phantomjs FAQ看到的。
http://phantomjs.org/faq.html

@miniflycn
Owner

可以试试~~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.