function ExportObjectGraph(Stream: TStream; const Options: TPdfObjectGraphInspectOptions; out Report: TPdfObjectGraphReport): Boolean;
function SaveAsObjectGraphPatched(Stream: TStream; const Operations: TPdfObjectPatchOperations; out Report: TPdfObjectGraphReport; AllowSignedDocument: Boolean = False): Boolean;
function SaveAsObjectGraphPatched(const FileName: string; const Operations: TPdfObjectPatchOperations; out Report: TPdfObjectGraphReport; AllowSignedDocument: Boolean = False): Boolean;
The root object, active object count, exported objects, and truncation state are emitted in the versioned pdf-object-graph-v1 envelope
Each value is identified as a dictionary, array, literal or hexadecimal string, name, reference, null, Boolean, integer, real, or keyword
Streams expose their encoded byte count and, when enabled, a SHA-256 digest while their payload remains omitted
Direct objects and members materialized from ObjStm containers use the same representation
| MaxObjects | Maximum active objects written before the JSON envelope reports truncated: true |
| MaxDepth | Maximum nested array and dictionary depth from 1 through 32 |
| MaxOutputBytes | Hard upper bound for the complete UTF-8-compatible JSON byte stream |
| MaxStringBytes | Maximum bytes retained from one PDF string or name |
| IncludeStreamDigests | Calculates SHA-256 over encoded stream bytes without decoding or exporting the payload |
Every TPdfObjectPatchOperation selects an exact object number, generation, and top-level dictionary key, then either sets or removes that key
Set operations accept typed null, Boolean, integer, real, name, text string, or indirect reference values and never accept raw PDF syntax
All object identities, generations, references, names, duplicate operations, and target dictionaries are validated before output is delivered
Stream length and filter-chain keys cannot be patched because changing them independently from encoded bytes would corrupt the stream
The writer appends one incremental revision, reconstructs the resulting active graph, strict-loads it through PDFium, and only then writes the caller stream or atomically replaces a file
AllowSignedDocument is explicitly enabled
Options := TPdfObjectGraphInspectOptions.Default;
Pdf.ExportObjectGraph(JsonStream, Options, Report);
SetLength(Operations, 1);
Operations[0].Kind := popSet;
Operations[0].ObjectNumber := CatalogObjectNumber;
Operations[0].Generation := 0;
Operations[0].Key := 'Lang';
Operations[0].Value.Kind := povTextString;
Operations[0].Value.TextValue := 'en-US';
Pdf.SaveAsObjectGraphPatched('patched.pdf', Operations, Report);