Skip to main content

DevExpress v24.1 Update — Your Feedback Matters

Our What's New in v24.1 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

Copy Document Content

  • 2 minutes to read

The PDF Viewer allows you to select and copy text and an image from the document to clipboard.

To enable the selection mode, invoke the context menu and choose the Select tool item (or set PdfViewerControl.CursorMode to CursorModeType.SelectTool).

SelectToolMenu

To copy an image:

  • select the image or any part of an image;
  • right click the image and select the Copy command in the context menu, or press Ctrl+C;

    CopyImage

  • paste the image into a desired application by choosing the Past command in the context menu, or pressing Ctrl+V.

To copy text:

  • highlight the text you desire;
  • choose the Copy command in the context menu, or press Ctrl+C;

    CopyText

  • paste the content into an application.

To select document content at the specified position in code, call the PdfViewerControl.Select method. To copy the selected content to clipboard, execute PdfViewerControl.CopyCommand.

To select all text in a document for copying:

SelectAll

You can get information about whether document content is selected using the PdfViewerControl.HasSelection property. To obtain selected content in code, call the PdfViewerControl.GetSelectionContent method.

You can also clear the current selection by calling the PdfViewerControl.UnselectAll method.

To perform specific actions each time an end-user started, continued or ended the selection of document content, handle PdfViewerControl.SelectionStarted, PdfViewerControl.SelectionContinued, and PdfViewerControl.SelectionEnded events.