title: how to use iTextSharp?
body: <p>So, I need a PDF generator for my ASP.NET application. I downloaded iTextSharp because it seems to be the most popular free one. But after searching the internet I am not really finding the information I need to get me started. The few tutorials I've found so far are too confusing. I know there's a book out there but I'm a student and don't want to spend the money. I just need really basic step-by-step information, preferably with code in VB. The most basic tutorial I've found so far is <a href="http://www.mikesdotnetting.com/Article/80/Create-PDFs-in-ASP.NET-getting-started-with-iTextSharp">http://www.mikesdotnetting.com/Article/80/Create-PDFs-in-ASP.NET-getting-started-with-iTextSharp</a>, but it's not working for me. I tried to follow it and came up with this code:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.UI;
  using System.Web.UI.WebControls;
  using iTextSharp.text;
  using iTextSharp.text.pdf;
  using System.IO; 
  
  
  public partial class Default3 : System.Web.UI.Page
  {
  protected void Page_Load(object sender, EventArgs e)
  {
      var doc1 = new Document();
      string path = Server.MapPath("PDFs");
      PdfWriter.GetInstance(doc1, new FileStream(path + "/Doc1.pdf", FileMode.Create));
      doc1.Open();
      doc1.Add(new Paragraph("My first PDF"));
      doc1.Close();
  }
  }
  </code></pre>
  
  <p>But it gives me an error: "CS1502: The best overloaded method match for 'iTextSharp.text.pdf.PdfWriter.GetInstance(iTextSharp.text.Document, System.IO.Stream)' has some invalid arguments" and the line highlighted is PdfWriter.GetInstance...</p>
  
  <p>So anyway, I was wondering if anyone knows either what I did wrong on this tutorial, or what other tutorials I can use. Or if you want to give me a basic explanation of how to get started in your own words, that would be great. Keep in mind I unfortunately know absolutely nothing about this. :) Thanks.</p>