PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
result.pages returns parse output page by page. Each page object includes metadata, a structured block list, and a lightweight content list. Additionally, result.detail provides a flat paragraph-level view across all pages.
| Field | Type | Meaning |
|---|---|---|
page_id | int | Page number (1-based) |
angle | float | Page rotation angle (after correction) |
height | int | Page pixel height |
width | int | Page pixel width |
image_id | string | Original image identifier (usually empty) |
durations | float | Processing time for this page (seconds) |
status | string | Processing status, e.g. Success |
structured | array | Structured block list for fine-grained rendering and positioning |
content | array | Lightweight content list for quick text access |
structured — structured blocks Best for detailed rendering, highlight positioning, and content reconstruction. Each block:
| Field | Type | Meaning |
|---|---|---|
id | int | Block sequence number |
type | string | Block type, e.g. doc_title, paragraph_title, text, table, image |
text | string | Extracted text |
pos | float[] | Quadrilateral coordinates [x1,y1, x2,y2, x3,y3, x4,y4] (top-left, top-right, bottom-right, bottom-left) |
outline_level | int | Heading level (-1 for non-heading) |
content | int[] | Referenced text block IDs linking to the content array |
{
"id": 0,
"type": "doc_title",
"text": "# Sample PDF",
"pos": [141, 154, 509, 154, 509, 220, 141, 220],
"outline_level": -1,
"content": [0]
}Common block types:
| Type | Meaning |
|---|---|
doc_title | Document title |
paragraph_title | Paragraph heading |
text | Body text |
table | Table |
image | Image |
figure | Figure / chart |
header / footer | Page header / footer |
footnote | Footnote |
formula | Formula |
content — lightweight content Better for quick consumption — concatenate into page-level text or build search indexes. Each item:
| Field | Type | Meaning |
|---|---|---|
id | int | Content block ID, linked from structured[].content |
type | string | Block type |
text | string | Text content |
pos | float[] | Quadrilateral coordinates |
score | float | Recognition confidence |
angle | float | Text angle |
{
"id": 0,
"type": "doc_title",
"text": "# Sample PDF",
"pos": [141, 154, 509, 154, 509, 220, 141, 220],
"score": 0.5958,
"angle": 0
}result.detail — cross-page paragraph view result.detail aggregates all paragraphs in reading order into a single flat array, eliminating the need to iterate through pages manually. Each record:
| Field | Type | Meaning |
|---|---|---|
paragraph_id | int | Paragraph sequence number |
page_id | int | Source page number |
type | string | Fixed as paragraph |
sub_type | string | Paragraph sub-type, e.g. doc_title, paragraph_title, text, table |
text | string | Paragraph text |
position | float[] | Quadrilateral coordinates |
outline_level | int | Heading level |
tags | string[] | Custom tags |
{
"paragraph_id": 1,
"page_id": 1,
"type": "paragraph",
"sub_type": "doc_title",
"text": "# Sample PDF",
"position": [141, 154, 509, 154, 509, 220, 141, 220],
"outline_level": -1,
"tags": []
}structured[].pos or content[].posstructured[].typeresult.markdown or iterate through contentresult.pages and consume structuredresult.detail directly