javascript - To create a snapshot function, how to directly generate images from the html page?
高洛峰
高洛峰 2017-05-16 12:02:06
0
5
404

After reading many answers on the Internet, they all said to generate pdf first and then convert it into pictures, but I tried it. Generating pdf from html will mess up the page style, and then use imagick to convert pdf into pictures. I have always installed this extension. Unsuccessful, there is nothing in phpinfo(), so I would like to ask if there is a one-step method to directly convert the html page into an image?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(5)
巴扎黑

html2canvas.js

洪涛

It should be regarded as a screenshot. phantomjs can simulate the browser kernel. Of course, taking screenshots is not a problem. You can search for usage

迷茫

It seems that there is a program called dom-to-image.js, which converts dom nodes into base64 strings. You can check it

巴扎黑

You can use imagegrabwindow to take screenshots

黄舟

rasterizeHTML.js This one is much better than that html2canvas.js, go check it out

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template