Generate PDF from HTML using itextsharp.dll

I want to generate PDF from an ASPX page using a css file. How can I do this using iTextSharp? I've downloaded itextsharp-all-5.5.7, but which of all the DLLs must I include in my asp.net c# project?

Posted on StackOverflow on Nov 20, 2015 by Cristian Capannini

These are the DLLs you need to include in your project:

  1. iTextSharp DLL: (Required) I am assuming that you downloaded itextsharp-all-5.5.7.zip You need the itextsharp.dll that is stored in itextsharp-dll-core.zip

  2. PDF/A, PDF/UA, ZUGFeRD DLL: (Optional) If you want to produce PDF/A or PDF/UA or ZUGFeRD PDFs rather than plain old PDFs, then you also need itextsharp.pdfa.dll from itextsharp-dll-pdfa.zip. I would highly recommend making your PDFs at least accessible for the blind and the visually impaired. Most developer just don't care about PDF/UA and that's problematic.

  3. XML Worker: (Required) Since you want to convert HTML to PDF, you also need to download XML Worker: itextsharp.xmlworker-all-5.5.7.zip. In this zip, you'll find itextsharp-dll-xmlworker.zip. You need itextsharp.xmlworker.dll because that's where you'll find all the XML Worker classes.



Ready to use iText?

Try our iText 7 Library and add-ons FREE for 30 days. Test your proof of concept, and see if our solution is right for you.

Get my FREE trial
Contact

Still have questions? 

We're happy to answer your questions. Reach out to us and we'll get back to you shortly.

Contact us
Stay updated

Join 11,000+ subscribers and become an iText PDF expert by staying up to date with our new products, updates, tips, technical solutions and happenings.

Subscribe Now