Skip to main content
Participant
Nov 18, 2026 6:38 AM UTC
Question

Rebuilding tables from PDF Extract API JSON for RAG: best way to keep row/column structure?

Hi everyone,

 

I'm working on a small RAG project and using the PDF Extract API to get tables out of PDFs. The problem is the table cells in the JSON come out as separate pieces, so when I flatten them the rows and columns get mixed up and the LLM gives wrong answers about the table.

 

For now I'm using a JSON parser tool to look at the output. All the data is there, but merged cells and headers don't line up properly.

 

What's the easiest way to keep the rows and columns together? Should I just use the CSV/XLSX table output instead?

 

Thanks in advance!