THPDFProgressiveLoadInfo Record
Reports linearization status, byte offsets, and range availability for progressive loading of a linearized PDF
Declaration
THPDFProgressiveLoadInfo= record
Status: THPDFProgressiveLoadStatus;
FileLength: Int64;
FirstPageEndOffset: Int64;
MainXRefOffset: Int64;
MainXRefRangeOffset: Int64;
MainXRefRangeLength: Int64;
FirstPageObjectNumber: Integer;
PageCount: Integer;
HeaderRangeAvailable: boolean;
FirstPageRangeAvailable: boolean;
MainXRefRangeAvailable: boolean;
WholeDocumentAvailable: boolean;
Diagnostic: AnsiString;
end;
Unit
HPDFDoc
Fields
| Field | Purpose |
|---|---|
Status | Progressive load verdict from pldsHeaderUnavailable through pldsDocumentReady |
FileLength | Total size of the source in bytes |
FirstPageEndOffset | Byte offset just past the self-contained first-page section |
MainXRefOffset | Declared offset of the main cross-reference section |
MainXRefRangeOffset | Main xref offset minus a 4096-byte look-behind, clamped at zero |
MainXRefRangeLength | Bytes from MainXRefRangeOffset to the end of the file |
FirstPageObjectNumber | Object number of the linearized first page |
PageCount | Total page count from the linearization dictionary |
HeaderRangeAvailable | True when the first 1024 header bytes are present in the source |
FirstPageRangeAvailable | True when every byte range of the first-page section is present |
MainXRefRangeAvailable | True when the main xref range is present in the source |
WholeDocumentAvailable | True when the entire file is available |
Diagnostic | Text describing what is available or why planning stopped |
Usage notes
- Fill it with
GetProgressiveLinearizedLoadInfobefore deciding whether to stream the first page or wait for the whole file - The offsets are the inputs
ReadProgressiveLinearizedFirstPageSectionuses to fetch a paintable first page from a partial download - A non-linearized file yields
pldsNotLinearizedwith the planner's own diagnostic text, so fall back to a normal full load