Method GetPageText
GetPageText(int, CancellationToken)
Gets the textual content of the specified page.
public string GetPageText(int pageIndex, CancellationToken cancellationToken = default)
Parameters
pageIndexintZero-based page index.
cancellationTokenCancellationTokenA 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
pageIndexis 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
pageIndexintZero-based page index.
modeTextOutputModeControls how raw lines are grouped and spaced in the output. See TextOutputMode.
cancellationTokenCancellationTokenA 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
pageIndexis negative or greater than the number of available text elements minus one.