PDFium Delphi Component Docs

AppendPdfSparseUpdate function

Unit: FPdfCompress
Streams one sparse revision onto a saved PDF without materialising the source in memory

Syntax

function AppendPdfSparseUpdate(Source, Dest: TStream; const Revision: TPdfSparseRevisionInfo; const Objects: TPdfSparseUpdateObjects; const TrailerExtra: AnsiString; const BeforeStartXref: AnsiString = ''; OmitPrev: Boolean = False): Boolean;

Parameters

Source, DestTStream
RevisionTPdfSparseRevisionInfo
ObjectsTPdfSparseUpdateObjects
TrailerExtraAnsiString
BeforeStartXrefAnsiString
OmitPrevBoolean

Return Value

Boolean

Description

Copies the source bytes verbatim, appends each supplied object body at its recorded offset, and emits a single incremental xref/trailer block whose /Prev chains onto the revision's previous xref

Every entry in Objects must carry a complete N G obj ... endobj body; the caller owns those bytes so the recorded offsets stay truthful

The revision's root object must be amongst the supplied objects because the fresh trailer restates /Root for readers that never look past the last revision

Returns False without writing when streams are nil or identical, no objects are supplied, an object number or generation is out of range, duplicate object numbers appear, or the root object is missing

Use ReadPdfSparseRevisionInfo and ComposePdfSparseUpdateId to build the revision facts and identifier

See Also

ReadPdfSparseRevisionInfo, ComposePdfSparseUpdateId