function SaveAsLinearized(Stream: TStream; Option: TSaveOption = saNone; PdfVersion: TPdfVersion = pvUnknown): Boolean;
function SaveAsLinearized(const FileName: string; Option: TSaveOption = saNone; PdfVersion: TPdfVersion = pvUnknown): Boolean;
| Stream | TStream that receives the complete linearized PDF |
| FileName | Output path replaced only after a sibling temporary file succeeds |
| Option | Normal save option or saRemoveSecurity; saIncremental is rejected |
| PdfVersion | Output version from PDF 1.2 upward, or pvUnknown to preserve the current version |
True when the linearized output was completed successfullyThe method first uses the normal PDFium save path as the semantic source, then rewrites the active object graph into Annex F order
Document-level and first-page objects are placed ahead of later page data, followed by a second cross-reference section and the remaining objects
Page-offset and shared-object hint tables use high-bit-first encoding and are Flate-compressed when compression reduces their size
Active xref-stream and object-stream members are materialised as ordinary indirect objects before references are renumbered
The output is designed for HTTP Range readers and can expose a requested page without transferring the complete document
saIncremental is not supported and existing digital signatures become invalidsaRemoveSecurity because object renumbering changes object-level encryption keys
// Create range-friendly output for web delivery
Pdf.SaveAsLinearized('report-web.pdf');