Hello,
I am looking to adjust the code below (From SDK Documentation) to highlight specific text found within a particular document. For example: The document contains a string that looks something like: Ref: 123456789 and my goal is to use an SDK Script Activity to highlight this text when found in the document. Note: This information always exists on page 1 to make things easier.
Your help is much appreciated!
Thanks,
Nate
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Data.SqlClient
Imports System.Text
Imports Laserfiche.RepositoryAccess
Namespace WorkflowActivity.Scripting.AssignTextAnnotation
'''<summary>
'''Provides one or more methods that can be run when the workflow scripting activity is performed.
'''</summary>
Public Class Script1
Inherits RAScriptClass92
'''<summary>
'''This method is run when the activity is performed.
'''</summary>
Protected Overrides Sub Execute()
'Document?
If Me.BoundEntryInfo.EntryType = EntryType.Document Then
'Get a reference to page 1
Dim pInfo As PageInfo = Document.GetDocumentInfo(Me.BoundEntryId, Me.RASession).GetPageInfo(1)
'Create the new highlight Annotation
Dim hA As HighlightAnnotation = New HighlightAnnotation
'Set the parameters of the text start/end
hA.TextStart = 900
hA.TextEnd = 976
hA.LinkTextToImage(new TextLinker(pInfo.ReadTextPagePartAsWords(), pInfo.ReadLocationsPagePart()))
hA.Color = Laserfiche.RepositoryAccess.Common.LfColor.FromAbgr(65535)
'Add the annotation to the page
pInfo.AddAnnotation(hA)
hA = Nothing
pInfo = Nothing
End If
End Sub
End Class
End Namespace