'''' This code is part of Document Solutions for PDF .NET demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystem.IOImportsSystem.DrawingImportsGrapeCity.Documents.PdfImportsGrapeCity.Documents.Pdf.Annotations '' This example shows how to create a caret annotation used to indicate a specific position in a text.PublicClassAddCaretAnnotationPublicFunctionCreatePDF(ByVal stream AsStream) AsIntegerUsing fs = File.OpenRead(Path.Combine("Resources", "PDFs", "Wetlands.pdf"))Dim doc = NewGcPdfDocument() doc.Load(fs) ForEach page In doc.PagesDim tm = page.GetTextMap()' insert the CaretAnnotation after "The Importance" text tm.FindText(NewFindTextParams("wetlands", False, False),Sub(fp_)' Add a CaretAnnotation near the found text:Dim r = fp_.Bounds(0).ToRect()Dim ca = NewCaretAnnotation() With { .Page = page, .Rect = NewRectangleF(r.Left - 8, r.Bottom - 16, 16, 16) }EndSub)Next' Done: doc.Save(stream)Return doc.Pages.CountEndUsingEndFunctionEndClass