ASP.NET 2.0 Resources

Powered by Blogger

Generating PDF documents with .NET

I was looking for a way to generate PDF documents in ASP.NET pages on the fly. When searching the net i came across a cool guide How to select PDF component for .NET. It covers many commercial and also some open source PDF generators. There are very nice comparison tables available. There is mentioned one open source project iTextSharp. When searching further i have also discovered an open source XHTML to PDF converter PDFizer.


iText# (iTextSharp) is a port of the iText open source java library written entirely in C# for the .NET platform. iText# is a library that allows you to generate PDF files on the fly. To use iTextSharp, you create a Document object, and then create a PdfWriter that listens to the Document and directs its output to a stream which could be a FileStream or some other type of stream entirely. You then use methods of the Document to add content. When you close the document, the writer takes everything you've dumped into the document and outputs it as a PDF file.

iTextSharp can handle quite a bit of advanced PDF formatting including embedded TrueType fonts, tables, links, outlines, graphics, and more. However, the documentation is limited to a set of online tutorials, and support is via the SourceForge discussion board for the project only.


A XHTML to PDF converter: with this library, you can transform simple XHTML pages to nice and printable PDF files. This project is based on the excellent webzine article "Pdfizer, a dumb HTML to PDF converter, in C#" written by Jonathan de Halleux.


Post a Comment

<< Home

Created dolly