I seem to be having an issue with iTextSharp in VB.NET. I am trying to create a new document and have the document be a Webpage that I have. Such as in the iTextSharp Tutorial, chapter 7 example 7. I have the code below.
End Class
My issue comes down to when I try to implement the HtmlParser.Parse(Doc,"~/Default.aspx"), it is telling me that the HtmlParser is not defined.
Can anyone help with this one, I am using the 5.0.2.0 version.
Bob Johnston
_______________________________________________
Please mark this post as answer if it helps.
Here is the error message when it runs through the complier.
Description:
An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30451: Name 'HtmlParser' is not declared.
Source Error:
Line 13: Dim Doc As New Document(PageSize.A4, 80, 50, 30, 65) Line 14: PdfWriter.GetInstance(Doc, New FileStream("/test.pdf", FileMode.Create)) Line 15: HtmlParser.Parse(Doc, "/Default.aspx") Line 16: End Sub Line 17: End Class
Source File: C:\Users\Bob\Documents\Visual Studio 2008\WebSites\WebSite\Maintain\PDF.aspx.vb
Line: 15
And when you view it from the Code Page, it has the blue line under it, indicating that it is not declared.
I am using version 5.0.2
Bob Johnston
_______________________________________________
Please mark this post as answer if it helps.
bobj181
Contributor
3806 Points
832 Posts
iTextSharp and VB.NET
Jun 01, 2010 06:14 PM|LINK
I seem to be having an issue with iTextSharp in VB.NET. I am trying to create a new document and have the document be a Webpage that I have. Such as in the iTextSharp Tutorial, chapter 7 example 7. I have the code below.
My issue comes down to when I try to implement the HtmlParser.Parse(Doc,"~/Default.aspx"), it is telling me that the HtmlParser is not defined.
Can anyone help with this one, I am using the 5.0.2.0 version.
_______________________________________________
Please mark this post as answer if it helps.
smirnov
All-Star
24594 Points
4192 Posts
Re: iTextSharp and VB.NET
Jun 01, 2010 08:55 PM|LINK
It might be that it cannot resolve tilde in the path of the page. Try to change to "default.aspx" or "/default.aspx" to see if it helps.
bobj181
Contributor
3806 Points
832 Posts
Re: iTextSharp and VB.NET
Jun 01, 2010 09:06 PM|LINK
Tried that, unfortunately, it did not work. it is only erroring out on the HTMLParser name. Nothing else.
_______________________________________________
Please mark this post as answer if it helps.
smirnov
All-Star
24594 Points
4192 Posts
Re: iTextSharp and VB.NET
Jun 01, 2010 10:11 PM|LINK
Can you please post the exact error message?
Your code looks correct. I see that you referenced to iTextSharp.text, I compared it with my projects and see no difference (I used v.4.1.2)
bobj181
Contributor
3806 Points
832 Posts
Re: iTextSharp and VB.NET
Jun 01, 2010 11:07 PM|LINK
Here is the error message when it runs through the complier.
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30451: Name 'HtmlParser' is not declared.
Source Error:
Source File: C:\Users\Bob\Documents\Visual Studio 2008\WebSites\WebSite\Maintain\PDF.aspx.vb Line: 15
And when you view it from the Code Page, it has the blue line under it, indicating that it is not declared.
I am using version 5.0.2
_______________________________________________
Please mark this post as answer if it helps.
Qin Dian Tan...
All-Star
113532 Points
12480 Posts
Microsoft
Re: iTextSharp and VB.NET
Jun 04, 2010 02:24 AM|LINK
Hi bobj181,
Please refer the solution in this post. You will get the answer: http://forums.asp.net/t/1270776.aspx
Thanks,
If you have any feedback about my replies, please contactmsdnmg@microsoft.com.
Microsoft One Code Framework