开发者

A "shortcut" method for exporting an ASP.Net Page to pdf/xls

I want to export a few Pages to pdf/xls. By Pages I mean as the eye sees it - a screenshot of the Page's contents. I know how to build pdf开发者_StackOverflow中文版/xls documents using 3rd party tools but is there any way to quickly export the rendered contents of say a Panel?

edit: maybe a tool that can render the page's output as a browser would, and save it as an image file?


There is an open source console program named wkhtmltopdf which you could call from asp.net to convert the page. It can convert to PDF or an image with wkhtmltoimage (JPG, PNG, etc.) using the webkit rendering engine.

Check my answer to this question to see an example of how to convert from a html to a pdf using C#:

Easiest way of porting html table data to readable document


I can recommend http://www.screengrab.org/ for firefox.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜