Versioned Object Graph JSON Round Trips
HotPDF can stream a complete loaded indirect-object graph to versioned JSON and reconstruct an editable document without flattening PDF values into a job description
Schema and compatibility
The current HotPDF-object-graph-2 schema records schemaVersion, minimumReaderVersion, PDF version, trailer Root and Info references, every selected indirect object, deleted object identifiers, and the snapshot or incremental kind
Readers accept the earlier HotPDF-object-graph-1 format for compatibility and reject future or incompatible schema versions before changing the target document
Use the v2 stream API for editing round trips because v2 records whether each stream payload is raw filtered data or decoded data
Streaming and binary payloads
ExportLoadedObjectGraphJSONToStream writes objects and recursively ordered PDF values directly to the destination stream without building a document-sized JSON string
Raw or decoded stream bytes can be omitted, embedded as chunked base64, or written as sidecar files under the supplied directory
Sidecar names are safe leaf names, publication uses a sibling temporary file followed by atomic replacement, and import rejects traversal or absolute paths
The importer reads fixed-size input blocks and materializes only one top-level object entry at a time while enforcing limits for JSON bytes, object count and number, value depth, string bytes, individual streams, and aggregate stream bytes
Snapshot and incremental modes
A snapshot exports the complete graph and ogjimReplace validates a candidate document before swapping it into the target
An incremental export contains dirty, must-write, and deleted objects only; ogjimUpdate validates references against the union of the existing graph and delta, then commits through the loaded graph transaction machinery
Any malformed value, unresolved reference, invalid Catalog or Pages tree, inconsistent direct or indirect stream Length, exhausted budget, or failed sidecar read leaves the target unchanged
Security boundary
The JSON graph contains PDF objects and trailer Root and Info relationships, but it never exports passwords, encryption keys, or active security-handler state
A replaced snapshot is therefore unencrypted until the application explicitly configures output protection before saving