Reputation: 105
So I saw this tutorial in codeproject http://www.codeproject.com/Articles/20640/Creating-PDF-Documents-in-ASP-NET. I used the itextsharp in my web project
Dim doc As Document = New Document
PdfWriter.GetInstance(doc, New FileStream("C:\Users\PC\Desktop" + _
"\1.pdf", FileMode.Create))
doc.Open()
doc.Add(New Paragraph("Hello World"))
doc.Close()
Response.Redirect("~/1.pdf")
with this syntax I get errors that 'myProjectName.Document' cannot be converted to 'iTextSharp.text.Document'and open, add ,close is not a member of 'myProjectName.Document'
My current framework is 3.5 . I have downloaded the sample project it was framework 2.0 but can still run when I changed it to 3.5,
Any workaround with my problem?
Upvotes: 0
Views: 968
Reputation: 8926
Looks like your Document
is coming from some other namespace, try specifying the namespace explicitly:
dim doc as iTextSharp.text.Document = new iTextSharp.text.Document() 'may need parameters to constructor
Upvotes: 1