EditTextToolApi.listBlocks()
The editable text blocks on a page, as
EditableTextBlock[]. Each block's text is '' under a license without extract.methodReadingsince 1.0.0
Signature
listBlocks(pageIndex: number): Promise<EditableTextBlock[]>
Parameters
| Parameter | Type | Description |
|---|---|---|
| pageIndex | number | Zero-based page index. |
Returns
Promise<EditableTextBlock[]> Each { id, pageIndex, text, bounds, fontFamily, fontSize, fontWeight, isItalic, fillColor, opacity }; id is stable within one detection pass, text includes an uncommitted edit, bounds is a Rect in page space.
Throws
INVALID_STATEwhile the tool is not active — withoutedit-textit cannot be activated.INVALID_ARGUMENTfor a page index the document has not.PAGE_ERRORwhen the page could not be loaded.
Example
TypeScript
const blocks = await viewer.tools.editText.listBlocks(0);