Change the highlight color of the text in Blazor SfPdfViewer Component

20 Jun 20231 minute to read

You can change the highlight color of the selected annotation using the Color property of the PdfViewerHighlightSettings class.

The following code illustrates how to change the highlight color of the text.

@using Syncfusion.Blazor.Buttons
@using Syncfusion.Blazor.SfPdfViewer

<!--Render simple PDF Viewer with customized highlight options-->
<SfPdfViewer2 @ref="PDFViewer"
    <PdfViewerHighlightSettings Color="@highlightColor">

    SfPdfViewer2 PDFViewer;
    //Sets the PDF document path for initial loading.
    private string DocumentPath { get; set; } = "Data/PDF_Succinctly.pdf";

    //Defines the color for text markup annotations like highlight.
    private string highlightColor = "Green";


Highlight Text in Blazor PDFViewer

View sample in GitHub.