PDFium Delphi Component Docs

ExportObjectGraph method

Component: TPdf  ·  Unit: PDFium
Write the object structure of the document to a stream as JSON, under explicit bounds

Syntax

function ExportObjectGraph(Stream: TStream; const Options: TPdfObjectGraphInspectOptions; out Report: TPdfObjectGraphReport): Boolean;

StreamTStream. Destination for the JSON output. nil raises EPdfError
OptionsTPdfObjectGraphInspectOptions. Bounds on the walk: MaxObjects, MaxDepth, MaxOutputBytes, MaxStringBytes, and IncludeStreamDigests. TPdfObjectGraphInspectOptions.Default supplies a usable starting point
ReportTPdfObjectGraphReport. Receives byte and object counts, a Truncated flag, Succeeded, and ErrorMessage
ResultBoolean. True when the export completed, matching Report.Succeeded

Description

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

See Also

SaveAsObjectGraphPatched, InspectOptionalContent, GetFeatureInventory