Method HasImageOnPageAsync
HasImageOnPageAsync(int, CancellationToken)
Asynchronously determines whether the specified page contains image content.
public Task<bool> HasImageOnPageAsync(int pageIndex, CancellationToken cancellationToken = default)
Parameters
pageIndexintZero-based index of the page to check.
cancellationTokenCancellationTokenA token to monitor for cancellation requests. Default: None.
Returns
- Task<bool>
A task whose result is
trueif the specified page exposes at least one image; otherwise,false.
Remarks
Image attachments always return true because the page itself is an image.
Paginated document formats (PDF, DOCX, PPTX, XLSX, EML, MBOX) delegate to the underlying
format-specific image detection. Text-only formats (plain text, HTML) always return false.
For attachments without page semantics, use pageIndex 0.
- See Also