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?
PHP中文网2017-05-16 12:04:06
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
迷茫2017-05-16 12:04:06
It seems that there is a program called dom-to-image.js, which converts dom nodes into base64 strings. You can check it
黄舟2017-05-16 12:04:06
rasterizeHTML.js This one is much better than that html2canvas.js, go check it out