HelloWorld.vb
''
'' This code is part of GrapeCity Documents for PDF samples.
'' Copyright (c) GrapeCity, Inc. All rights reserved.
''
Imports System.IO
Imports System.Drawing
Imports GrapeCity.Documents.Pdf
Imports GrapeCity.Documents.Text

'' One of the simplest ways to create a "Hello, World!" PDF.
Public Class HelloWorld
    Sub CreatePDF(ByVal stream As Stream)
        '' Create a new PDF document:
        Dim doc = New GcPdfDocument()
        '' Add a page, get its graphics:
        Dim g = doc.NewPage().Graphics
        '' Draw a string on the page.
        '' Notes:
        '' - For simplicity, here we are using a standard PDF font
        ''   (the 14 standard fonts' metrics are built into GcPdf and are always available);
        '' - GcPdf coordinates start at top left corner of a page, using 72 dpi by default:
        g.DrawString(
            "Hello, World, from GcPdf and VB.NET!",
            New TextFormat With {
                .Font = StandardFonts.Times,
                .FontSize = 12
            },
            New PointF(72, 72))
        '' Save the PDF
        doc.Save(stream)
    End Sub
End Class