Words in a table are not a table
If you concatenate the page, the numbers fall out in an order that depends on coordinates. The header they belonged to is gone.
Recovery starts by finding the grid: rules, alignment, and gaps. Then each cell stays under its header.
Keep two views
A compact Markdown table is easy to read and to place in a prompt. Merged cells and exact positions do not fit that syntax.
DocIR can carry the block type and the page. When the route measured geometry, the box can travel with the block. When it did not, leave the box out instead of inventing one.
Check one row by hand
Pick a row whose value would be wrong if it shifted one column. Compare the Markdown with the page image or the digital page.
Large tables should be chunked with the header repeated on each piece, and the full table kept so a retrieved row can be checked in context.
When a grid becomes a table block
On the PDF text-layer path, a detected grid is kept as a table block only when it has at least two rows, between two and twelve columns, at least four non-empty cells, and an average cell length of at least 2.5 characters. A thinner grid stays ordinary text.
The block stores rows as string arrays and a Markdown projection. pageIndex is the zero-based file position. A table caption that begins with Table or Tab. plus a number is classified as a table caption, not as a section heading.
A grid of A, B, 1, and 2 has four cells and an average length of 1, so the 2.5-character rule keeps it as ordinary text. A grid of Segment, FY25, Platform, and 82 has the same shape and a higher average, so it can be stored as a table block. Read block.type. Aligned words in the Markdown are not enough.
- Read block.type === table and block.rows, not only the Markdown.
- Reject a table wider than 12 columns on this path; it was not emitted as a grid.
- Repeat the header when a long table is split for retrieval.
- Check one cell that would be wrong if it moved one column.
{
"id": "b000004",
"type": "table",
"pageIndex": 0,
"rows": [["Segment", "FY25"], ["Platform", "82"]]
}
The file to send
Send a text-based PDF whose table looks like Segment, FY25, Platform, 82. Read block.rows for that grid.
A grid of A, B, 1, 2 stays ordinary text because the average cell length is under 2.5. A grid wider than 12 columns is not emitted as a table block on the text-layer path.
- Check one cell that would be wrong one column over.
- pageIndex on the block starts at 0.
- A Table 1 caption is a caption, not a heading.
export DOCPARSE_URL="https://docparse.genedai.me"
export DOCPARSE_API_KEY="your_key"
curl -fsS -X POST \
"$DOCPARSE_URL/v1/parse?wait=true" \
-H "Authorization: Bearer $DOCPARSE_API_KEY" \
-F "file=@document.pdf" \
-F "mode=both" \
-o result.json
jq -r '.result.markdown' result.json
jq '.result.document.schemaVersion, .result.document.pages[0].blockIds' result.json
jq '.result.manifest.decision.route, .result.manifest.parserVersion' result.json
Frequently asked questions
Questions this guide answers
Is a Markdown table enough?
Markdown is the readable projection of a simple grid. The table block's rows array is what an application should trust for a cell, together with pageIndex.
Why do table numbers attach to the wrong column?
The text was linearized by position and the grid was lost. On the text-layer path a grid has to pass the row, column, and cell-length checks before it is stored as a table block.
Can a scanned table be extracted?
A suspected scan or high-fidelity layout pass requires an approved paid workspace. A trial key that sets suspectedScanned or highFidelity receives a 403. An empty PDF page on the deterministic path may still carry a local OCR fallback warning.