GetSelectedText
Gets selected text on page
Syntax
expression.GetSelectedText();
expression - A variable that represents a ApiPage class.
Parameters
This method doesn't have any parameters.
Returns
string
Example
Select the text on the page and return it.
// How to get selected text for a page?
// Get selected text and display the result in a PDF document.
let doc = Api.GetDocument();
let page = doc.GetPage(0);
page.SetSelection({x: 10, y: 10}, {x: 100, y: 100});
console.log(`The selected text is: ${page.GetSelectedText()}`);