Breaking News
Loading...
Wednesday 13 March 2013

How to genetate PDF file using C#.Net

For generating PDF file using c# application follow the instruction  :

1) fist open your VS-2010
2) Add reference to it "itextsharp";
3) download this file from here;
4) after downloading  you have to add this as a reference
5) now add namspace like :
           
         using iTextSharp.text;
            using iTextSharp.text.pdf;

6)now write bellow code in form load event

private void Form1_Load(object sender, EventArgs e)
{
            string str = @"||  Jay Hanumna  -  Jay Madi ||   _  Nirav daraniya";
            string path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + "/nirav1.pdf";
            Document dc = new Document();
            FileStream fs = File.Create(path);
            PdfWriter.GetInstance(dc, fs);
            dc.Open();
            dc.Add(new Paragraph("Jay hanuman - Jay madi"+str));
            dc.Close();
 }


7)  Now run your application and show result.............

Download Code : PDF Creator in c#.net
See Also :
  Follow Me On Facebok


--/\/ir@\/  <(.'.)>

0 comments:

Post a Comment

Thanks for comment

 
Toggle Footer