Tutorial :ASP.NET - PDF Component in Medium Trust


Can anyone recommend some ASP.NET-compatible PDF Components that work in a medium trust environment? I read that ITextSharp works well, but coming from ABCPdf and ASPPdf, the thought of compiling the entire PDF in code is very daunting. Ideally I'd like to use something like wkhtmltopdf to simply convert HTML pages to PDFs (but of course that doesn't work in medium trust).

As far as price is concerned: free is best, but paid solutions are not out of the question.

In the event I cannot find a decent option I may choose to just host a web service on a separate machine that I can run a fully trusted application on, but that is definitely not optimal.


iTextSharp is possibly the best free option that works in medium trust. It can seem daunting to start using it, however once you get the hang of it it is very powerful. There is a tutorial available for both simple and more complex document layouts.

iTextSharp - http://sourceforge.net/projects/itextsharp/

iTextSharp Tutorial - http://itextsharp.sourceforge.net/tutorial/index.html

iTextSharp in medium trust - http://instantdevelopment.blogspot.com/2009/10/itextsharp-pdf-rendering-in-medium.html

I've just been through a similar exercise to generate documents. I looked at ReportViewer for a designer interface and PDFSharp for a cleaner API, but neither will currently work in a medium trust environment. iTextSharp was the best option I could find that met my requirements - free and medium trust compatible.


While not only a PDF library, our Data Dynamics Reports product is already supported in medium trust as noted in this stackoverflow thread. We are working on making ActiveReports work in medium trust very soon - the developers are working on it as we speak (I literally just saw an email discussion about documenting it). For handy reference some links from the other stackoverflow thread:


You could try the winnovative library:


Or the CETE library


I've used both for different features in ASP.NET web applications

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »