Converting HTML to an Image [duplicate]
Po开发者_高级运维ssible 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.
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?
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.
精彩评论