如何使用 iTextSharp 将我的网页导出为 pdf

How can i export my web page to pdf using iTextSharp


我使用本教程:http://www.aspsnippets.com/Articles/Export-ASPNet-Web-Page-with-images-to-PDF-using-ITextsharp.aspx
将我的页面转换为 pdf,但是当我 运行 项目时,我收到此错误:

An exception of type 'System.InvalidOperationException' occurred in System.Web.dll but was not handled in user code

Additional information: RegisterForEventValidation can only be called during Render(); how can i solve this?

教程的作者建议转到 http://www.aspsnippets.com/Articles/RegisterForEventValidation-can-only-be-called-during-Render.aspx 解决问题