VB.NET PDF: How to HTML5 PDF Viewer PDF Create PDF Export File & Page Process PDF Read PDF Write Form Process Document Protect Annotation & Drawing PDF Print WPF PDF Viewer Work with Other SDKs Barcode Read Barcode Create OCR Twain
Text comment
Home ›› XDoc.PDF ›› VB.NET PDF: Add Text

VB.NET PDF - Annotate Text on PDF Page in VB.NET

Professional VB.NET Solution for Adding Text Annotation to PDF Page in VB.NET

Add Annotation – Add Text Overview

Adding text is the most direct method to add or supplement information on current PDF page. RasterEdge XDoc.PDF SDK provides this annotation functionality to help VB.NET users add any texts to any position on PDF pages.

Since RasterEdge XDoc.PDF SDK is based on .NET framework 2.0, users are enabled to use it in any type of a 32-bit or 64-bit .NET application, including ASP.NET web service and Windows Forms for any .NET Framework version from 2.0 to 4.5.

How to VB.NET: Add Text to PDF Page

Add necessary references:









Use corresponding namespaces;

  using RasterEdge.Imaging.Basic;

  using RasterEdge.XDoc.PDF;

This is a piece of VB.NET demo code to add text annotation to PDF page.

Dim inputFilePath As String = Program.RootPath + "\\" + "2.pdf"
Dim outputFilePath As String = Program.RootPath + "\\" + "Annot_11.pdf"

' open a PDF file
Dim doc As PDFDocument = New PDFDocument(inputFilePath)
' get the 1st page
Dim page As PDFPage = doc.GetPage(0)

' create the annotation
Dim annot As PDFAnnotText = New PDFAnnotText()

annot.Boundary = New RectangleF(400.0F, 500.0F, 300.0F, 80.0F)

annot.Content = "This is a text annotation"

' add annotation to the page
PDFAnnotHandler.AddAnnotation(page, annot)

' save to a new file