PrefetchAsync(Int32, CancellationToken) Method

Definition

Namespace Broadside
Assembly Broadside.dll

Gets the page at index once the objects reading it needs are cached: for a remote document, its page object (through the page offset hints of a linearized file, else the page tree) and then what PrefetchAsync(CancellationToken) fetches.

public Task<PdfPage> PrefetchAsync(int index, CancellationToken cancellationToken = default(CancellationToken))

Parameters

index
Int32

The index: 0 for the first page.

cancellationToken
CancellationToken

Cancels the requests.

Returns

Task<PdfPage>
The page; already completed for a document whose bytes are all at hand.

Remarks

Spec #33, viewer capability 5; ISO 32000-2 Annex G, G.4 (going to another page of an open document). Where SynchronousRangeFetch is off (the browser), asking a linearized remote document for a page it has not fetched throws PdfRangeNotLoadedException; this is the asynchronous way to get it.