'''' This code is part of Document Solutions for PDF .NET demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystemImportsSystem.IOImportsSystem.DrawingImportsGrapeCity.Documents.PdfImportsGrapeCity.Documents.Pdf.AnnotationsImportsGrapeCity.Documents.Common ' This example shows how to find all occurrences of a word in a PDF document' and highlight all those occurrences using the text markup highlight annotation.'' The PDF used in this example was downloaded from https://www.frontiersin.org/articles/10.3389/fendo.2022.1005722/full.PublicClassFindAndHighlightPublicFunctionCreatePDF(stream AsStream) AsInteger' Load an existing PDF:Dim doc = NewGcPdfDocument()Using fs = File.OpenRead(Path.Combine("Resources", "PDFs", "fendo-13-1005722.pdf")) doc.Load(fs) ' Find all occurrences of the word "childbirths":Dim found = doc.FindText(NewFindTextParams("childbirths", True, False), Nothing) ' Add a text markup annotation to highlight each occurrence:ForEach f In foundDim markup = NewTextMarkupAnnotation() With { .Page = doc.Pages(f.PageIndex), .MarkupType = TextMarkupType.Highlight, .Color = Color.Yellow }Dim area As List(OfQuadrilateral) = New List(OfQuadrilateral)ForEach b In f.Bounds area.Add(b)Next markup.Area = areaNext ' Done: doc.Save(stream)Return doc.Pages.CountEndUsingEndFunctionEndClass