'''' This code is part of Document Solutions for PDF .NET demos.'' Copyright (c) MESCIUS inc. All rights reserved.''ImportsSystem.IOImportsSystem.DrawingImportsSystem.Collections.GenericImportsGrapeCity.Documents.PdfImportsGrapeCity.Documents.Pdf.AnnotationsImportsGrapeCity.Documents.Common PublicClassFindAndUnderlinePublicFunctionCreatePDF(ByVal stream AsStream) AsInteger' Load the PDF:Dim doc = NewGcPdfDocument()Using fs = File.OpenRead(Path.Combine("Resources", "PDFs", "The-Rich-History-of-JavaScript.pdf")) doc.Load(fs) ' Find all occurrences of "JavaScript" or "ECMAScript" using regex:Dim ft = NewFindTextParams("JavaScript|ECMAScript", wholeWord:=False, matchCase:=False, regex:=True)Dim found = doc.FindText(ft, Nothing) ' Add a text markup annotation to underline each occurrence:ForEach f In foundDim markup = NewTextMarkupAnnotation() With { .Page = doc.Pages(f.PageIndex), .MarkupType = TextMarkupType.Underline, .Color = Color.Red }Dim area AsNewList(OfQuadrilateral)ForEach b In f.Bounds area.Add(b)Next markup.Area = areaNext ' Done: doc.Save(stream)Return doc.Pages.CountEndUsingEndFunctionEndClass