Skip to content

Document Pipeline

Overview

The document pipeline renders a structured document in two phases: setup then render. Setup produces the complete geometry — surface dimensions, content area, and every block's exact position — before any content is drawn. Render takes that geometry and draws each block into its pre-computed position in order.

Features

  • Three block types: TextBlock, ImageBlock, TableBlock
  • Flex layout engine for block positioning
  • Text overflow continuation across blocks
  • Base style shared across all blocks, overridable per block
  • Multi-format output: PNG, SVG, PDF, NumPy array
  • Text bounding boxes per block at any granularity level
  • Block bounding boxes (AABB) — surface, content area, and each block; available from setup, before rendering

Code and Output

Example Code Output
figure_caption code output
multilingual code output
simple_table code output
song_lyrics code output
text_bboxes code output
two_columns_page code output
reaction_meme code output