Converting HTML to an Image [duplicate]

2019-09-21 07:19发布

Possible Duplicates:
Convert URL to screenshot (script).
PHP: How to capture browser window screen with php?

I have a URL and I want to convert that webpage screenshot to an image. Please let me know if we can do this using php or some other tools that can be used with PHP/Linux.

2条回答
该账号已被封号
2楼-- · 2019-09-21 07:39

This isn't the best solution, but you could convert the HTML page to a PDF, then use imagemagick to convert the pdf to a jpeg using this command exec("convert sample.pdf sample.jpeg"). To convert HTML to pdf, see this question.

Convert HTML + CSS to PDF with PHP?

查看更多
你好瞎i
3楼-- · 2019-09-21 07:40

The shutter screenshot tool is able to do that.

It's in the menu: File -> New -> Web

Can be used with Linux and PHP on the same system. See the manpage for commandline options to be invoked from PHP.

查看更多
登录 后发表回答