简体   繁体   中英

How to Convert a Div content to image?

I have a div and inside it exists one gridview and few other divs. Now I want to convert its contents to an image and store it on the server. I don't want to send it to client. How can I do it?

页面内容将在浏览器中处理,浏览器在客户端,因此您现在不希望在服务器端看到它,在服务器端我们只有html和脚本...因此,ddrace给出的链接可能有用,或者您可以开发Windows应用程序并在其上放一个Web浏览器,然后在浏览器中加载页面并将浏览器的图像保存到服务器

You're going to have to use a piece of middleware to do this. I have used this one in the past: http://www.winnovative-software.com/Html-To-Pdf-Converter.aspx . I know it says "to PDF", but one of it's features is that it can render the result to an image and save it in various image formats.

In your web application, have the middleware components bring the web-page down that has your control etc on it, and save it as an image on the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM