function ExportObjectGraph(Stream: TStream; const Options: TPdfObjectGraphInspectOptions; out Report: TPdfObjectGraphReport): Boolean;
| Stream | TStream. Destination for the JSON output. nil raises EPdfError |
| Options | TPdfObjectGraphInspectOptions. Bounds on the walk: MaxObjects, MaxDepth, MaxOutputBytes, MaxStringBytes, and IncludeStreamDigests. TPdfObjectGraphInspectOptions.Default supplies a usable starting point |
| Report | TPdfObjectGraphReport. Receives byte and object counts, a Truncated flag, Succeeded, and ErrorMessage |
| Result | Boolean. True when the export completed, matching Report.Succeeded |
Serialises the indirect objects of the document - dictionaries, arrays, names, numbers, and stream headers - into JSON, which turns "what is actually in this file" into something a script or a diff can work on
Every limit is explicit, and hitting one sets Truncated rather than failing: a malformed or hostile file cannot make the export run unbounded. IncludeStreamDigests adds a hash per stream so two files can be compared without exporting stream contents
To change objects rather than inspect them, feed patch operations to SaveAsObjectGraphPatched