Skip to main content

Module legacy_json

Module legacy_json 

Source
Expand description

Legacy-compatible JSON serializer.

Produces JSON output with the legacy schema, including:

  • Space-separated key names (“file name”, “page number”, “bounding box”, …)
  • Array-style color format (“[0.0, 0.0, 0.0]” for black, “[r, g, b]” for RGB)
  • Globally sequential integer IDs
  • Element types: heading, paragraph, list, table, image, caption, header, footer
  • BoundingBox as [left_x, bottom_y, right_x, top_y] float array

Functions§

to_legacy_json_string
Serialize a PdfDocument to a legacy-compatible JSON string.
to_legacy_json_value
Convert a PdfDocument to a legacy-schema JSON Value.