ByteScout PDF SDK - VB.NET - Add Text Annotation in PDF - ByteScout

ByteScout PDF SDK – VB.NET – Add Text Annotation in PDF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF SDK – VB.NET – Add Text Annotation in PDF

How to add text annotation in PDF in VB.NET and ByteScout PDF SDK

This tutorial will show how to add text annotation in PDF in VB.NET

The sample source codes on this page shows how to add text annotation in PDF in VB.NET. ByteScout PDF SDK: the library for pdf documents generation, modification and updates. Can also generate and fill PDF forms. Provides support for text (fonts, style, size, font family), layers, pdf form fields, vector and raster drawings. It can add text annotation in PDF in VB.NET.

This code snippet below for ByteScout PDF SDK works best when you need to quickly add text annotation in PDF in your VB.NET application. This VB.NET sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Use of ByteScout PDF SDK in VB.NET is also explained in the documentation included along with the product.

ByteScout free trial version is available for download from our website. It includes all these programming tutorials along with source code samples.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Program.vb
      
Imports Bytescout.PDF ''' <summary> ''' This example demonstrates how to add a text annotation. ''' </summary> Class Program Shared Sub Main() ' Create new document Dim pdfDocument = New Document() pdfDocument.RegistrationName = "demo" pdfDocument.RegistrationKey = "demo" ' Add page Dim page = New Page(PaperFormat.A4) pdfDocument.Pages.Add(page) ' Add collapsed annotation (shown as a tooltip when mouse is over the icon) Dim collapsedAnnotation = New TextAnnotation(20, 20) collapsedAnnotation.Color = New ColorRGB(255, 255, 0) collapsedAnnotation.Icon = TextAnnotationIcon.Comment collapsedAnnotation.Author = "Mr. Important" collapsedAnnotation.Contents = "The quick brown fox jumps over the lazy dog." page.Annotations.Add(collapsedAnnotation) ' Add expanded annotation Dim expandedAnnotation = New TextAnnotation(20, 50) expandedAnnotation.Color = New ColorRGB(255, 0, 0) expandedAnnotation.Icon = TextAnnotationIcon.Note expandedAnnotation.Open = True expandedAnnotation.Author = "John Doe" expandedAnnotation.Contents = "The quick brown fox jumps over the lazy dog." page.Annotations.Add(expandedAnnotation) ' Save document to file pdfDocument.Save("result.pdf") ' Cleanup pdfDocument.Dispose() ' Open document in default PDF viewer app Process.Start("result.pdf") End Sub End Class

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF SDK Home Page

Explore ByteScout PDF SDK Documentation

Explore Samples

Sign Up for ByteScout PDF SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout PDF SDK Home Page

Explore ByteScout PDF SDK Documentation

Explore Samples

Sign Up for ByteScout PDF SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next