How to create pdf file in windows form c#

March 16, 2015 0 Comments

If you wan to create pdf file in windows form as well as web application , you must to add iTextSharp.dll file as a reference. In iTextSharp , we have a Document class through which we can create a new document. Also provide PdfWriter class, through which we can create a pdf file in a specified path. Now, you can use Paragraph class for creating text. Now, use this code and Generate pdf file:

Document d1 = new Document();
            PdfWriter.GetInstance(d1, new FileStream("E:/t1.pdf", FileMode.Create));
            Paragraph p1 = new Paragraph("Hello World");

Video cover all such things which is i mentioned in above. Also provide the link where you can download the iTextSharp.dll file and where you will put the mentioned code in function.

Jacob Lefore

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google