Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating PDF documents in ASP.NET [duplicate]

Tags:

asp.net

pdf

Possible Duplicate:
Directly convert .aspx to .pdf

Is there any way to generate PDF document from asp.net directly from the page output. My requirement is, when user visits a page on my website, there should be a provision to get the same page / report in PDF format. Using iTextSharp, we need to built layout logic agin to generate PDF. If there are any changes in page output in future, I again need to work on logic to generate PDF. Instead I want to generate PDF directly from the page output just by setting "Response.ContentType" property.

like image 936
Max Avatar asked Jul 28 '10 17:07

Max


1 Answers

One strategy I use is to develop reports using SQL Server Reporting Services. SSRS reports support export to PDF out of the box.

If you use SSRS 2008, you can even assign arbitrary HTML to a text box and the reporting engine will interpret it fairly well. This allows you to retrieve a snippet of HTML from any page, and present it in a report that will export to PDF without having to manually generate PDF document elements with iTextSharp.

If you go the SSRS 2008 route, check out this thread: http://forums.asp.net/t/1443965.aspx

I hope this helps.

Happy Coding!

like image 185
kbrimington Avatar answered Sep 30 '22 17:09

kbrimington