Skip to main content

PdfViewer.HighlightSelectedText(Color) Method

Highlights the selected text with a filled rectangle.

Namespace: DevExpress.Maui.Pdf

Assembly: DevExpress.Maui.Pdf.dll

NuGet Package: DevExpress.Maui.Pdf

Declaration

public void HighlightSelectedText(
    Color color = null
)

Optional Parameters

Name Type Default Description
color Color null

The highlight fill color. null corresponds to the “#F9A825” color.

Remarks

The following code snippet highlights the selected text on a button tap:

private void DXButton_Clicked(object sender, EventArgs e) {
    pdfViewer.HighlightSelectedText(Color.FromArgb("70ffea00"));
}

The HighlightSelectedText method does not automatically save changes to the document. Users can save documents in the Share UI. To invoke it, call the PdfViewer.ShareDocumentAsync() method or the PdfViewerCommands.ShareDocument command. You can also call the PdfViewer.SaveDocumentAsync method to save the current document to a stream.

You can also use the PdfViewerCommands.HighlightSelectedText command to highlight the selected text.

Refer to the following help topic for more information about selection and highlighting in the PDF viewer control: Select and Highlight Content in DevExpress PDF Viewer for .NET MAUI.

See Also