i m using asp.net mvc2 for my application. i have a view that accepts a model and renders its data in some format. i want this page to be converted into pdf file so it can be sent via attachment or created and downloaded on the fly. i have some success creating pdf with itextsharp library but they say it has very basic support for html and css. if anyone has rendered complex html pages to pdf using itextsharp or any other library plz help me in solving this problem. any comments are highly appreciated
thanks
I think this related question will help to a degree. Just note that HTML displays and PDF documents serve different purposes as described here. The basic thought is that the latter “is designed for print output”, and the other “is designed for video display”.
My suggestion is that in most cases when one prints from the web, there is an option to create a separate stylesheet for printing using this declaration. The idea is to dumb down the styling and make it more print friendly (=less complex).
The following article from A List Apart provides some further insight into this option.
The other free PDF library to look at is PDFSharp. However, they do not support conversion from HTML to PDF.
Other related SO questions