可能重复:
Convert URL to screenshot (script).
PHP: How to capture browser window screen with php?HTML转换为图像
我有一个网址,我想该网页截图转换为图像。请让我知道,如果我们可以使用PHP或其他可用于PHP/Linux的工具来做到这一点。
可能重复:
Convert URL to screenshot (script).
PHP: How to capture browser window screen with php?HTML转换为图像
我有一个网址,我想该网页截图转换为图像。请让我知道,如果我们可以使用PHP或其他可用于PHP/Linux的工具来做到这一点。
这不是最好的解决方案,但您可以将HTML页面转换为PDF,然后使用imagemagick将PDF转换为JPEG格式,使用此命令exec("convert sample.pdf sample.jpeg")
。要将HTML转换为pdf,请参阅此问题。
我会看看戈登的评论,如果是你想要做的,他所展示的问题是比这更为理想的解决方案。 – Zoidberg 2011-06-14 10:33:37
的shutter screenshot tool是能够做到这一点。
它在菜单:File
- >New
- >Web
可与Linux和PHP在同一系统上使用。请参阅manpage for commandline options以从PHP中调用。
另一个可能的重复:[用PHP生成图像的html](http://stackoverflow.com/questions/6702986/generate-image-from-html-with-php) – hakre 2011-08-05 10:42:27