THotPDF.LinearizeOutput Property
Controls whether a newly generated document is written in a dependency-ordered linearized layout for fast first-page display over an HTTP byte-range transport
Declarations
// Delphi
property LinearizeOutput: Boolean;
// C++Builder
__property bool LinearizeOutput;
Default
False
Output layout
When enabled before BeginDoc and EndDoc, HotPDF performs a bounded layout pass and then writes the destination stream directly in linearized order
- The linearization parameter dictionary is contained in the first 1024 bytes
- The first page and its private dependencies precede later page sections
- Shared dependencies are grouped so range-aware readers can avoid redundant requests
- The primary hint stream contains page-offset and shared-object hint tables
- An early cross-reference table supports first-page access and a main cross-reference table completes the document
Compatibility and limits
- Linearization requires PDF 1.2 or later; HotPDF upgrades an older selected version unless
StrictVersionLockis enabled, in which case writing raises an exception - The linearized writer emits traditional text cross-reference tables and unpacked indirect objects even when
UseXRefStreamorUseObjectStreamsis enabled - The hint-table format uses 32-bit offsets, so output at or above 4 GiB is rejected with a clear exception
- The web server or storage transport must support byte-range requests to provide fast first-page delivery
- This property changes generated-document output and does not progressively load an existing remote PDF
Delphi example
PDF := THotPDF.Create(nil);
try
PDF.FileName := 'fast-view.pdf';
PDF.Version := pdf17;
PDF.LinearizeOutput := True;
PDF.BeginDoc;
PDF.Canvas.TextOut(72, 72, 'First page');
PDF.EndDoc;
finally
PDF.Free;
end;
C++Builder example
std::unique_ptr<THotPDF> pdf(new THotPDF(nullptr));
pdf->FileName = L"fast-view.pdf";
pdf->Version = pdf17;
pdf->LinearizeOutput = true;
pdf->BeginDoc();
pdf->Canvas->TextOut(72, 72, L"First page");
pdf->EndDoc();