Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PdfViewer.UnderlineSelectedText(Color) Method

Underlines the selected text with a straight line.

Namespace: DevExpress.Maui.Pdf

Assembly: DevExpress.Maui.Pdf.dll

NuGet Package: DevExpress.Maui.Pdf

#Declaration

C#
public void UnderlineSelectedText(
    Color color = null
)

#Optional Parameters

Name Type Default Description
color Color null

The line color.

#Remarks

The following code snippet underlines selected text on button tap:

private void DXButton_Clicked(object sender, EventArgs e) {
    pdfViewer.UnderlineSelectedText(Color.FromArgb("ff7200"));
}

The UnderlineSelectedText method does not automatically save changes to the document. To invoke the system Save File dialog to allow users to save the current document to the file system, call the PdfViewer.ShowSaveFileDialogAsync method or the PdfViewerCommands.ShowSaveFileDialog command. Users can also save documents in the Share UI. To invoke it, call the PdfViewer.ShareDocumentAsync method or the PdfViewerCommands.ShareDocument command. Call the PdfViewer.SaveDocumentAsync method to save the current document to a stream.

You can also use the PdfViewerCommands.UnderlineSelectedText command to highlight 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