Skip to main content

Overview

Use this script to extract and save each parsed chunk as a separate PNG. This is useful for building datasets, analyzing chunk quality, or processing individual document regions.
These examples require the Python or TypeScript client library. Before running a script, set your API key and install the library and any required dependencies.

Scripts

Directory Structure for Saved Images

Images are saved with this structure:
Where:
  • TIMESTAMP is the time and date the document was parsed (format: YYYYMMDD_HHMMSS for Python, ISO format for TypeScript)
  • page_0 is the zero-indexed page number
  • ChunkType is the chunk type
  • CHUNK_ID is the unique chunk identifier (UUID format)
Example output: