Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 11th, 2011, 05:30 AM
Registered User
 
Join Date: Feb 2011
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default understand a ASP.NET code

hi everyone ,
i've just started working with ASP.NET and i really appreciate if you will help me with some code : http://www.dotnetspark.com/kb/Content.aspx?id=654

i've created a file : itextsharp.aspx and i've placed this code :
Code:
Protected Sub btnGeneratePDF_Click(ByVal sender As Object, ByVal e As EventArgs) 
'Create Document class obejct and set its size to letter and give space left, right, Top, Bottom Margin 
Dim doc As New Document(iTextSharp.text.PageSize.LETTER, 10, 10, 42, 35) 
Try 05 Dim wri As PdfWriter = PdfWriter.GetInstance(doc, New FileStream("c:\Test11.pdf", FileMode.Create)) 
'Open Document to write 07 doc.Open 08 09 'Write some content 
Dim paragraph As New Paragraph("This is my first line using Paragraph.") 
Dim pharse As New Phrase("This is my second line using Pharse.") 
Dim chunk As New Chunk(" This is my third line using Chunk.") 
' Now add the above created text using different class object to our pdf document 14 doc.Add(paragraph) 
doc.Add(pharse) 
doc.Add(chunk) 
Catch dex As DocumentException 
'Handle document exception 
Catch ioex As IOException 
'Handle IO exception 
Catch ex As Exception 
'Handle Other Exception 
Finally 
'Close document 
doc.Close() 
End Try
End Sub
then downloaded itextsharp.dll and placed it in the same directory of itexsharp.aspx and here what i got :
Code:
Message d'erreur du compilateur: 
BC30002: Type 'Document' is not defined. 
Erreur source: Ligne 3 : Protected Sub
btnGeneratePDF_Click(ByVal sender As Object, ByVal e As EventArgs) 
Ligne 4 : Ligne 5 : Dim doc As New Document(iTextSharp.text.PageSize.LETTER, 10, 10, 42, 35) Ligne 6 : Ligne 7 : Try Fichier source: c:\inetpub\wwwroot\ing2010\ing_scripts\fr\itextsharp.aspx Ligne: 5
will be pleased if you guys give me a hand
 
Old February 11th, 2011, 07:36 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You're better off posting this in an ASP.NET forum. You now posted it in a classic ASP forum: http://p2p.wrox.com/asp-net-asp-12/

That said, did you add a reference to the project as explained in the article? And did you add the necessary Imports statements (called using in C# / in the article)?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
understand a piece of code in assembler rbulus BOOK: Professional Assembly Language 1 January 10th, 2010 07:45 AM
Trying to understand this line of code chriscym XSLT 2 April 17th, 2007 10:48 PM
can't understand this code I downloaded am6019a VB How-To 1 July 7th, 2006 09:11 AM
Can someone help me understand Quake III's code PaRaDoX C++ Programming 2 March 23rd, 2005 08:09 PM
i need to understand this wrox code saudyonline General .NET 2 October 31st, 2004 12:07 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.