Method GetPageTextAsync
GetPageTextAsync(int, CancellationToken)
Asynchronously gets the textual content of the specified page.
public Task<string> GetPageTextAsync(int pageIndex, CancellationToken cancellationToken = default)
Parameters
pageIndexintZero-based page index.
cancellationTokenCancellationTokenA token to monitor for cancellation requests. Default: None.
Returns
- Task<string>
A task whose result is 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.
Exceptions
- ArgumentOutOfRangeException
Thrown when
pageIndexis negative or greater than the number of available text elements minus one.
GetPageTextAsync(int, TextOutputMode, CancellationToken)
Asynchronously gets the textual content of the specified page, formatted with the given mode.
public Task<string> GetPageTextAsync(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
- Task<string>
A task whose result is 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.