在asp.net上点击按钮,以.pdf格式保存网页 [英] Save webpage in .pdf format on button click in asp.net

查看:64
本文介绍了在asp.net上点击按钮,以.pdf格式保存网页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hello All。



如何在asp.net

按钮点击后以便携式文档格式(.pdf)保存网页解决方案

首先,您应该了解PDF结构与Web页面有很大不同,Web页面通常以流畅的方式呈现,并且它的视图取决于页面大小而在某种程度上取决于浏览器虽然PDF文档是完全僵硬的,并且表现得像在纸上打印。因此,您需要以您选择的某种方式将页面内容映射到PDF结构。



要生成PDF本身,您可以真正使用iText的.NET端口;这个端口叫做iTextSharp:

http://en.wikipedia.org/wiki/IText [ ^ ],

http://itextpdf.com/ [ ^ ],

http://sourceforge.net/projects/itextsharp/ [ ^ ]。



我也提供了iText的链接,因为几乎所有使用iTextSharp的文档都在那里,以Java文档的形式提供。



-SA

Hello All.

How can i save webpage in portable document format (.pdf) on button click in asp.net

解决方案

First of all, you should understand that PDF structures is very different from a Web page, which is usually rendered in a fluid way and the view of it depends on the page size and somewhat on the browser, while PDF document is totally rigid and behaves like it is printed on paper. So, you need to map your page content onto PDF structure in some way you choose.

To produce PDF itself, you can really use the .NET port of iText; this port is called iTextSharp:
http://en.wikipedia.org/wiki/IText[^],
http://itextpdf.com/[^],
http://sourceforge.net/projects/itextsharp/[^].

I provided links to iText, too, because nearly all documentation you need to work with iTextSharp is there, provided as Java documentation.

—SA


这篇关于在asp.net上点击按钮,以.pdf格式保存网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆