| FoxitPDFSDKforWeb v11.0.6 Archives Foxit PDF SDK for Web

Public Member Functions | List of all members
TextSelectionTool Class Reference
PDFViewCtrl » interfaces

This class is used in text selection tools in <tooltip-layer>. For more details on usage please refer to this example: -examples{UIExtension/customize-text-selection-tool/index.html}. More...

Inheritance diagram for TextSelectionTool:

## Public Member Functions
| copy ()
| Copy the current selected text into system clipboard. More...
| getSelectionInfo ()
| Obtains the current text selection information. More...
Public Member Functions inherited from Disposable
| addDestroyHook (...hooks)
| Add a function to destroyHooks list, which will be called during destroy. More...
| destroy ()
| ownsTo (owner)
| Establishes an ownership relationship where this instance will be destroyed when the owner is destroyed. Additionally, the owner will be automatically removed from the destroyHooks list when this instance is destroyed. More...

## Detailed Description

This class is used in text selection tools in <tooltip-layer>. For more details on usage please refer to this example: -examples{UIExtension/customize-text-selection-tool/index.html}.

Since
  7.2

## Member Function Documentation

## ◆ copy()

TextSelectionTool::copy | ( |  | ) |
| inline

Copy the current selected text into system clipboard.

Returns
  Promise<void>

## ◆ getSelectionInfo()

TextSelectionTool::getSelectionInfo | ( |  | ) |
| inline

Obtains the current text selection information.

Returns
  Promise<{
  text: string, // selected text
  page: PDFPage, // The page where the selected text is located
  rectArray: Array<{left:number, top:number, right:number, bottom:number, text:number}> }> - // Boundaries of each line of selected text

@2025 Foxit Software Incorporated. All rights reserved.