Public Class modify_existing_pdf
    Inherits System.Web.UI.Page

    Protected Sub BtnCreatePdf_Click(sender As Object, e As EventArgs)
        ' the initial file
        Dim file As String = Server.MapPath("~/files/doc1.pdf")

        ' load the pdf document
        Dim doc As New PdfDocument(file)

        ' add a new page to the document
        Dim page As PdfPage = doc.AddPage()

        ' create a new pdf font (component standard font)
        Dim font As PdfFont = doc.AddFont(PdfStandardFont.Helvetica)
        font.Size = 20

        ' create text element and add it to the new page
        Dim text As New PdfTextElement(100, 100, _
                "Sample text added to an existing pdf document.", font)
        page.Add(text)

        ' save pdf document
        doc.Save(Response, False, "Sample.pdf")

        ' close pdf document
        doc.Close()
    End Sub
End Class