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
Here's the entire tutorial: (sorry its not a tutorial but thats what they call it)
Imports System
Imports System.IO
Imports iTextSharp.text
Imports iTextSharp.text.pdf
Namespace iTextSharp.tutorial.Chap04
Public Class Chap0404
Public Sub New()
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
End Class
End Namespace