Skip to content

Spatial Text Output Options

Spatial text output options allow you to configure how text positioning and layout are preserved in the spatial text output format.

Spatial text is a text format where whitespace is strategically inserted to preserve the spatial positioning of text elements on the page. Instead of flowing text in reading order, spatial text maintains the original layout by using spaces and line breaks to keep elements in their correct relative positions.

This format is particularly useful for:

  • Documents with complex layouts (forms, tables, diagrams)
  • Preserving visual relationships between text elements
  • Maintaining column structures and alignments
  • CAD drawings or technical documents where positioning matters

Preserve text alignment across page boundaries. This is useful for documents with continuous tables or consistent alignment that spans multiple pages.

{
"output_options": {
"spatial_text": {
"preserve_layout_alignment_across_pages": true
}
}
}

Include very small text in the spatial output. This can be useful for documents containing vector graphics with very small text lines that may not be recognized by OCR or vision models (such as in CAD drawings).

{
"output_options": {
"spatial_text": {
"preserve_very_small_text": true
}
}
}

Keep column structure intact without unrolling. By default, LlamaParse tries to unroll columns into reading order. Enable this option to maintain the original column layout.

{
"output_options": {
"spatial_text": {
"do_not_unroll_columns": true
}
}
}

You can combine multiple spatial text options:

{
"output_options": {
"spatial_text": {
"preserve_layout_alignment_across_pages": true,
"preserve_very_small_text": true,
"do_not_unroll_columns": false
}
}
}
Terminal window
curl -X 'POST' \
'https://api.cloud.llamaindex.ai/api/v2/parse' \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $LLAMA_CLOUD_API_KEY" \
--data '{
"file_id": "<file_id>",
"tier": "fast",
"version": "latest",
"output_options": {
"spatial_text": {
"preserve_layout_alignment_across_pages": true,
"preserve_very_small_text": true
}
}
}'