Skip to content

Commit ddd40ca

Browse files
Merge pull request #1486 from syncfusion-content/984373-pv-textsearch
984373: Update setting documentation for the text search
2 parents 156aed8 + 962a3ca commit ddd40ca

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed
99.2 KB
Loading

Document-Processing/PDF/PDF-Viewer/blazor/text-search.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,24 @@ Text search can also be performed programmatically using the following APIs: [Se
7979
8080
}
8181
82-
```
82+
```
83+
84+
## Customize text search highlight colors
85+
86+
Use the [PdfViewerTextSearchColorSettings](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerTextSearchColorSettings.html) to customize the highlight appearance used for search results. Configure [SearchColor](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerTextSearchColorSettings.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerTextSearchColorSettings_SearchColor) for other matches and [SearchHighlightColor](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.SfPdfViewer.PdfViewerTextSearchColorSettings.html#Syncfusion_Blazor_SfPdfViewer_PdfViewerTextSearchColorSettings_SearchHighlightColor) for the current match. By default, distinct colors are applied for current and other occurrences; adjust these to align with application theme requirements.
87+
88+
```cshtml
89+
90+
@using Syncfusion.Blazor.SfPdfViewer
91+
92+
<SfPdfViewer2 Height="100%" Width="100%" DocumentPath="@DocumentPath">
93+
<PdfViewerTextSearchColorSettings SearchColor="blue" SearchHighlightColor="red"></PdfViewerTextSearchColorSettings>
94+
</SfPdfViewer2>
95+
96+
@code{
97+
public string DocumentPath { get; set; } = "wwwroot/Data/PDF_Succinctly.pdf";
98+
}
99+
100+
```
101+
102+
![Blazor SfPdfViewer text search highlight color customization](./images/blazor-pdfviewer-text-search-settings.png)

0 commit comments

Comments
 (0)