interface TextSelectToolType {
    addSelect: (
        pageView: PageViewType,
        formRects: FloatRectArrayType,
    ) => Promise<void>;
    clearSelection: () => Promise<void>;
    destroy: () => Promise<void>;
    getSelectedText: () => Promise<string>;
    getSelectedText2: (lineBreakBetweenPages: boolean) => Promise<string>;
    options: Options;
}

Implemented by

Properties

addSelect: (
    pageView: PageViewType,
    formRects: FloatRectArrayType,
) => Promise<void>

Add a selection to the specified page view.

Type declaration

let doc = await app.getActiveDoc();
let docView = await doc.getCurrentDocView();
let pageView = await docView.getCurrentPageView();
let textSelectTool = await TextSelectTool.create({ doc });
await textSelectTool.addSelect(pageView, rectArray);
clearSelection: () => Promise<void>

Clear the selection.

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

destroy: () => Promise<void>

Destroy the TextSelectTool object.

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

getSelectedText: () => Promise<string>

Get the selected text.

Type declaration

    • (): Promise<string>
    • Returns Promise<string>

      Returns the selected text.

getSelectedText2: (lineBreakBetweenPages: boolean) => Promise<string>

Get the selected text.

Type declaration

    • (lineBreakBetweenPages: boolean): Promise<string>
    • Parameters

      • lineBreakBetweenPages: boolean

        If true, add line breaks between pages.

      Returns Promise<string>

      Return the selected text.

options: Options