php - 将 HTML 转换为图像

标签 php html linux image

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

我有一个 URL,我想将该网页屏幕截图转换为图像。请告诉我我们是否可以使用 php 或其他可与 PHP/Linux 一起使用的工具来完成此操作。

最佳答案

这不是最好的解决方案,但您可以将 HTML 页面转换为 PDF,然后使用 imagemagick 使用此命令 exec("convert example.pdf example.jpeg") 将 pdf 转换为 jpeg。要将 HTML 转换为 pdf,请参阅此问题。

Convert HTML + CSS to PDF with PHP?

关于php - 将 HTML 转换为图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6342178/

相关文章:

linux - 如何检查磁盘读取或写入利用率

linux - 不使用 -S 选项对 ls -alh 的输出值进行排序

c++ - ARM 上的qt3 : cannot bind packed field

php - Swift httppost 数据未插入到 MySQL 数据库

javascript - 谷歌搜索框需要移动到屏幕中间(X :0 Y:0)

php - 权限被拒绝 : httpd: could not open error log file/etc/httpd/logs/error_log

javascript - 无论如何要等待打印窗口在 print.js 中关闭

javascript - 表长度属性转换为字符串不返回任何内容

php - 如何获取特定cookie的域?

javascript - 通过 AJAX 接收 PHP 的响应