Coding

World of PDF – 2

This entry is in continuation to my earlier post “World of PDF”. You need to read this first if you are new to creating PDF files.

Today in the Chennai .NET User GroupPrashanthan K pointed to an interesting link to iTextSharp. This 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.

I am yet to try this out. But the sample is pretty impressive. A “Hello World” file in PDF is generated with the following 5 lines of code!!!.

<br />
Document document = new Document();<br />
PdfWriter.getInstance(document, new FileStream(&quot;Chap0101.pdf&quot;, FileMode.Create));<br />
document.Open();<br />
document.Add(new Paragraph(&quot;Hello World&quot;));<br />
document.Close();<br />

Happy PDFing in .NET