save/export image file from html content?

后端 未结 4 1714
日久生厌
日久生厌 2020-12-13 16:25

I have a scenario that, I am creating dynamic html content and I need to export/save the html content to an image file with php, jQuery and JavaScript [or with any other if

4条回答
  •  不知归路
    2020-12-13 16:39

    You can draw the html onto a canvas. https://developer.mozilla.org/en/HTML/Canvas/Drawing_DOM_objects_into_a_canvas

    and then save the canvas as an image to the server. http://motyar.blogspot.com/2010/04/save-html5-canvas-data-as-image.html

    Or send the html to the server and render it server-side:

    https://github.com/visionmedia/screenshot-app or http://cutycapt.sourceforge.net/

提交回复
热议问题