0

我需要导出我的 ASP 网页,其中包含 Telerik 控件、一些 ASP 控件、页眉和页脚横幅。单击按钮后,我想将此页面上的所有内容导出为 PDF。我试过 iTextSharp ,它只允许将 HTML 元素转换为 PDF。有没有免费的第三方东西可以做到这一点?

4

1 回答 1

0

You need to get html content of your .aspx page and then you can convert html code to PDF with any 3rd party library. To get the html content of this page you can try something like that:

StringWriter objStringWriter = new StringWriter();
HtmlTextWriter objHtmlWriter = new HtmlTextWriter(objStringWriter);
form1.RenderControl(objHtmlWriter);
string html_sting = objStringWriter.ToString();

Where form1 is your main form on .aspx page.

于 2013-04-12T05:45:37.093 回答