Table of Contents

Method GetPageText

Namespace
LMKit.Data
Assembly
LM-Kit.NET.dll

GetPageText(int, CancellationToken)

Gets the textual content of the specified page.

public string GetPageText(int pageIndex, CancellationToken cancellationToken = default)

Parameters

pageIndex int

Zero-based page index.

cancellationToken CancellationToken

A token to monitor for cancellation requests. Default: None.

Returns

string

The extracted plain-text content for the requested page; an empty string if no text is available.

Remarks

When the attachment does not expose page semantics, the entire content is associated with a single element and pageIndex must be 0. Consider HasText to check whether any text is available.

Exceptions

ArgumentOutOfRangeException

Thrown when pageIndex is negative or greater than the number of available text elements minus one.

GetPageText(int, TextOutputMode, CancellationToken)

Gets the textual content of the specified page, formatted with the given mode.

public string GetPageText(int pageIndex, TextOutputMode mode, CancellationToken cancellationToken = default)

Parameters

pageIndex int

Zero-based page index.

mode TextOutputMode

Controls how raw lines are grouped and spaced in the output. See TextOutputMode.

cancellationToken CancellationToken

A token to monitor for cancellation requests. Default: None.

Returns

string

The extracted plain-text content for the requested page, formatted according to mode; an empty string if no text is available.

Remarks

When the attachment does not expose page semantics, the entire content is associated with a single element and pageIndex must be 0.

Exceptions

ArgumentOutOfRangeException

Thrown when pageIndex is negative or greater than the number of available text elements minus one.