Skip to content

modern-pdf-lib


modern-pdf-lib / extractTextWithPositions

Function: extractTextWithPositions()

extractTextWithPositions(operators, resources?): TextItem[]

Defined in: src/parser/textExtractor.ts:268

Extract text with position information from a parsed content stream.

Each returned TextItem includes the text string, its position (x, y), dimensions (width, height), font size, and font name.

Parameters

operators

ContentStreamOperator[]

Parsed content-stream operators.

resources?

PdfDict

Optional page /Resources dictionary.

Returns

TextItem[]

An array of positioned text items.

Released under the MIT License.