i did an Imports iTextSharp.text.rtf - error TYPE EXPECTED on 'graphic'

View: New views
2 Messages — Rating Filter:   Alert me  

i did an Imports iTextSharp.text.rtf - error TYPE EXPECTED on 'graphic'

by Alex Gordon-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

i did this:

Imports iTextSharp.text.rtf

and then this:

Dim grx As graphic = New graphic

and on the first "graphic" i am getting a "type expected"

graphic is a member of iTextSharp.text.rtf

here's the surrounding code:


Public Sub New1()
   
Console.WriteLine("Chapter 4 example 4: Simple Graphic")
   
Dim document As Document = New Document
   
Try
       
PdfWriter.GetInstance(document, New FileStream("Chap0404.pdf", FileMode.Create))
        document
.Open()
       
Dim grx As graphic = New graphic
        grx
.Rectangle(100, 700, 100, 100)
        grx
.MoveTo(100, 700)
        grx
.LineTo(200, 800)
        grx
.Stroke()
        document
.Add(grx)
   
Catch de As DocumentException
       
Console.Error.WriteLine(de.Message)
   
Catch ioe As IOException
       
Console.Error.WriteLine(ioe.Message)
   
End Try
    document
.Close()
End Sub

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions

Re: i did an Imports iTextSharp.text.rtf - error TYPE EXPECTED on 'graphic'

by MaMani :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Actually, Graphic in iTextSharp.Text.rtf is a namespace not a class and as
you know it can't be instantiated. My concern is how the Graphic class is
not available in the assembly, whereas in the tutorial they have done few
examples using the same.

Is that included in the latest version?

Cheers,
Mathavan.M



                                                                           
             Alex Gordon                                                  
             <aleksandr.gordon                                            
             @gmail.com>                                                To
                                       itextsharp-questions@...
             08/26/2009 03:40          rge.net                            
             AM                                                         cc
                                                                           
                                                                   Subject
             Please respond to         [itextsharp-questions] i did an    
               Post all your           Imports iTextSharp.text.rtf - error
              questions about          TYPE EXPECTED on 'graphic'          
              iTextSharp here                                              
             <itextsharp-quest                                            
             ions@...                                            
                forge.net>                                                
                                                                           
                                                                           




i did this:


Imports iTextSharp.text.rtf


and then this:


Dim grx As graphic = New graphic




and on the first "graphic" i am getting a "type expected"


graphic is a member of iTextSharp.text.rtf


here's the surrounding code:





Public Sub New1()    Console.WriteLine("Chapter 4 example 4: Simple
Graphic")    Dim document As Document = New Document    Try
PdfWriter.GetInstance(document, New FileStream("Chap0404.pdf",
FileMode.Create))        document.Open()        Dim grx As graphic = New
graphic        grx.Rectangle(100, 700, 100, 100)        grx.MoveTo(100,
700)        grx.LineTo(200, 800)        grx.Stroke()
document.Add(grx)    Catch de As DocumentException
Console.Error.WriteLine(de.Message)    Catch ioe As IOException
Console.Error.WriteLine(ioe.Message)    End Try    document.Close()

End Sub
------------------------------------------------------------------------------

Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day

trial. Simplify your report design, integration and deployment - and focus
on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions





------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
itextsharp-questions mailing list
itextsharp-questions@...
https://lists.sourceforge.net/lists/listinfo/itextsharp-questions