PdfViewer.Highlight
Overloads
Highlight(String, MatchOptions) | Highlights the specified string throughout the document. |
Highlight(String, MatchOptions, Color) | Highlights the specified string throughout the document with the specified color. |
Highlight(String, MatchOptions)
Highlights the specified string throughout the document.
public void Highlight(string searchTerm, MatchOptions option)
Sub Highlight(searchTerm As String, option As MatchOptions)
Parameters
- searchTerm
- String
The string to be highlighted.
- option
- MatchOptions
The match option to be used to search and highlight the string.
Licensing Info
This method is a DynamicPDF Viewer feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Viewer selected.
- A DynamicPDF Viewer for .NET v3.X Developer license.
Examples
The following example will show how to highlight a string throughout the document with a match option.Imports System
Imports System.Windows.Forms
Imports ceTe.DynamicPDF.Viewer
Public Class Form1
Inherits System.Windows.Forms.Form
Private MyPdfViewer As PdfViewer
Sub New()
InitializeComponent()
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
End Sub
Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub Highlight()
' Highlights a string throughout the document.
MyPdfViewer.Highlight("string", MatchOptions.WholeWordOnly)
End Sub
End Class
using System;
using System.Windows.Forms;
using ceTe.DynamicPDF.Viewer;
namespace DynamicPDFViewerDemo
{
public class Form1 : Form
{
private ceTe.DynamicPDF.Viewer.PdfViewer dpdfViewer;
public Form1()
{
InitializeComponent();
}
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.dpdfViewer = new PdfViewer();
this.Controls.Add(dpdfViewer);
}
private void Highlight()
{
// Highlights a string throughout the document.
Highlight("string" , MatchOptions.WholeWordOnly);
}
}
}
Highlight(String, MatchOptions, Color)
Highlights the specified string throughout the document with the specified color.
public void Highlight(string searchTerm, MatchOptions option, Color TextHighlightColor)
Sub Highlight(searchTerm As String, option As MatchOptions, TextHighlightColor As Color)
Parameters
- searchTerm
- String
The string to be highlighted.
- option
- MatchOptions
The match option to be used to search and highlight the string.
- TextHighlightColor
- Color
The search item highlight color.
Licensing Info
This method is a DynamicPDF Viewer feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Viewer selected.
- A DynamicPDF Viewer for .NET v3.X Developer license.
Examples
The following example will show how to highlight a string throughout the document with a match option and specified color.Imports System
Imports System.Windows.Forms
Imports ceTe.DynamicPDF.Viewer
Public Class Form1
Inherits System.Windows.Forms.Form
Private MyPdfViewer As PdfViewer
Sub New()
InitializeComponent()
End Sub
Private Sub InitializeComponent()
Me.MyPdfViewer = New PdfViewer()
Me.Controls.Add(MyPdfViewer)
End Sub
Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub Highlight()
' Assign the color to which the text needs to be highlighted.
Color highlightColor = (Color.FromArgb(90, 110, 0, 255));
' Highlights a string throughout the document.
MyPdfViewer.Highlight("string", MatchOptions.WholeWordOnly)
End Sub
End Class
using System;
using System.Windows.Forms;
using ceTe.DynamicPDF.Viewer;
namespace DynamicPDFViewerDemo
{
public class Form1 : Form
{
private ceTe.DynamicPDF.Viewer.PdfViewer dpdfViewer;
public Form1()
{
InitializeComponent();
}
[STAThread]
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.dpdfViewer = new PdfViewer();
this.Controls.Add(dpdfViewer);
}
private void Highlight()
{
// Assign the color to which the text needs to be highlighted.
Color highlightColor = (Color.FromArgb(90, 110, 0, 255));
// Highlights a string throughout the document.
Highlight("string" , MatchOptions.WholeWordOnly,highlightColor);
}
}
}