DAStartRangeSourcePrefetch
Direct access functionality, Progressive loading, Performance
Description
Queues the same dependency-driven background work as StartRangeSourcePrefetch for a direct-access range-backed handle
Syntax
Delphi
Function TPDFlib.DAStartRangeSourcePrefetch(FileHandle, DataKind, Index,
Priority: Integer; MaxBytes: Int64= 0;
ReadAheadBytes: Integer= 0; MaxPasses: Integer= 0): Integer;Parameters
| FileHandle | Direct-access handle returned by DAOpenFile or DAOpenFromStream whose reader is backed by TByteRangeStream |
|---|---|
| DataKind | PDF_RANGE_DATA_PAGE, PDF_RANGE_DATA_FORM or PDF_RANGE_DATA_OBJECT |
| Index | A one-based page number, zero for the form query, or an indirect object number |
| Priority | PDF_RANGE_PREFETCH_PRIORITY_LOW, PDF_RANGE_PREFETCH_PRIORITY_NORMAL, PDF_RANGE_PREFETCH_PRIORITY_HIGH or PDF_RANGE_PREFETCH_PRIORITY_CRITICAL |
| MaxBytes | Job read budget in bytes; 0 selects 64 MiB and an explicit value must hold at least one source chunk |
| ReadAheadBytes | Extra bytes scheduled after each discovered dependency range before chunk alignment; 0 disables read-ahead |
| MaxPasses | Maximum dependency-discovery rounds; 0 selects 128 |
Return values
A positive job handle local to the direct-access stream, or zero with LastErrorCode set to 401
Remarks
The direct-access file must be backed by TByteRangeStream
DACloseFile cancels queued and running jobs and waits for the active synchronous read to return before releasing the stream