Text - Parse Document to Content
Type identifier:
text:parseDocumentToContentCategory: Text Operations
Description
Parses PDF files into structured content. Extracts text with page-level granularity, generates page images, and splits content into chunks.
Input Handles
Handle | Data Type | Required | Description |
|---|---|---|---|
|
| Yes | The document file to parse |
|
| No | Dynamic page rendering scale |
Input Handle Details
document
- Type:
file - Supported Formats: PDF
pageScale
- Type:
number(0-10) Notes:
- Controls image quality for page rendering
Output Handles
Handle | Data Type | Description |
|---|---|---|
|
| Text chunks from document |
|
| Page-level data with images |
|
| Document metadata |
|
| Triggered on parsing error |
Output Handle Details
content
- Type:
string[] Notes:
- Text split into chunks
- Respects
chunkSizeandchunkOverlap - Ready for embedding or search indexing
pages
- Type: Array of page objects
Includes:
- Page number
- Page text
- Rendered page image (file)
metadata
- Type: Object
Includes:
title: Document titletotalPages: Number of pagesdocumentId: PDF document IDinstanceId: PDF instance ID
Configuration Options
Property | Type | Required | Default | Description |
|---|---|---|---|---|
|
| Yes |
| Display label |
|
| Yes |
| Characters per chunk |
|
| Yes |
| Overlap between chunks |
|
| No |
| Page render scale |
Configuration Details
chunkSize
- Type:
number - Default:
750characters - Notes: Target size for each text chunk
chunkOverlap
- Type:
number - Default:
20characters - Notes: Overlap between consecutive chunks to maintain context
pageScale
- Type:
number, literal or dynamic - Range: 0-10
- Default: 2
Notes:
- Higher values = better quality, larger images
- Dynamic: the scale comes from the
pageScaleinput handle
Behaviour
Execution Flow
- Resolves
documentinput handle - Validates the file input
- Loads the file
- Parses PDF
- Extracts text from each page
- Renders page images at configured scale
- Splits text into chunks
- Returns content, pages, and metadata
PDF Processing
- Supports standard PDF features
- Handles encrypted PDFs (if password-free)
Text Splitting
Chunks are split as follows:
- Attempts to split at natural boundaries (paragraphs, sentences)
- Falls back to character boundaries
- Maintains overlap for context continuity
Error Handling
Scenario | Behaviour |
|---|---|
No file entry | Throws error |
Invalid file entry | Throws error |
PDF parse failure | Triggers |
Corrupted PDF | Triggers |
Examples
Basic Document Parsing
{
"type": "text:parseDocumentToContent",
"data": {
"label": "Parse PDF",
"chunkSize": 750,
"chunkOverlap": 20
}
}Large Chunk Processing
{
"type": "text:parseDocumentToContent",
"data": {
"label": "Parse for Summarization",
"chunkSize": 2000,
"chunkOverlap": 100,
"pageScale": { "type": "literal", "value": 1 }
}
}High Quality Page Images
{
"type": "text:parseDocumentToContent",
"data": {
"label": "Parse for Display",
"chunkSize": 750,
"chunkOverlap": 20,
"pageScale": { "type": "literal", "value": 4 }
}
}