Web page screenshots were previously implemented only in asp.net. next I will introduce how to use a plug-in linux to allow php to implement web page screenshots. I hope it will be helpful to you. server: to implement a program, you must use the server program, c... web page screenshots were previously implemented only in asp.net. next I will introduce how to use a plug-in linux to allow php to implement web page screenshots. I hope it will be helpful to you.
Server: For the implementation of the program must rely on the server-side program, http://code.google.com/p/wkhtmltopdf/
You can convert a webpage to a pdf or image. The difference between 32 and 64-bit is that you can find a version suitable for your server.
Installation:The installation process is very simple: extract the package and find a proper path to put it down...
Run:Command line call 1, the code is as follows:
/Servers/app/qtwebkit/wkHtmlToImage phprm.com www.phprm.com.png
The default definition is relatively high, and the image size will be large. it takes some time to generate the image.
The php code is as follows:
Exec ('/servers/app/qtwebkit/wkHtmlToImage phprm.com www.phprm.com.png ');
The code is as follows:
Chinese garbled characters:It mainly depends on whether the server supports the Chinese language. if garbled characters appear, simply install a Chinese package. the code is as follows:
Yum install fonts-chinese
Article URL:
Reprint ^ at will, but please attach the tutorial address.