' Collection of code snippets by Arne Vajhøj 
' (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
Imports System
Imports System.IO
Imports iTextSharp.text
Imports iTextSharp.text.pdf

Public Class Chap0101
    Public Shared Sub Main()
        Console.WriteLine("Chapter 1 example 1: Hello World")
        Dim document As Document = New Document
        Try
            PdfWriter.getInstance(document, New FileStream("C:\Chap0101.pdf", FileMode.Create))
            document.Open
            document.Add(New Paragraph("Hello World"))
        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 
