A PDF has no tables in it. Only glyphs with coordinates.
Quarry rebuilds the table your PDF threw away, using row bands, whitespace projection, and the ruling lines the document drew. It runs in your tab, and it shows you every box before you export.
Copy a table out of a PDF viewer and paste it somewhere. You get a column of mush: every cell on its own line, the grid gone. The instinct is to blame the paste. The real reason is that the PDF never had a table in it to begin with.
A PDF page is a list of drawing instructions. Put this glyph at x=412.7, y=203.1, in this font, at this size. Draw a line from here to there. That is essentially the whole model. There is no cell, no row, no column, no marker saying "this block is tabular." A table in a PDF is a visual coincidence: text that happens to line up, sometimes with lines drawn around it, and your eyes do the rest. Every tool that pulls a table out of a PDF is reconstructing structure that got thrown away the moment the document was made.
Quarry does that reconstruction in a browser tab and hands you a CSV. It exists because the two existing answers both have a catch. Cloud extractors want you to upload the document, and the documents that are dense with tables are exactly the ones you often cannot upload: a filing under embargo, a medical record, an internal report you were handed for due diligence. Tabula, the desktop tool everyone still reaches for, is a Java install that solved this a decade ago and works as a black box: when it misreads a table's boundary, your move is to re-run the whole extraction and hope.
Rebuilding a grid from positions
pdf.js parses the file in the tab and hands over the raw primitives: text runs with positions, and the vector graphics the page drew. Quarry works entirely from that geometry.
Rows come from vertical overlap. Text runs whose vertical extents overlap each other are one horizontal band, and a band is a row. Columns come from projecting every piece of text in a block straight down onto the x axis and looking at where nothing lands. Those gaps, the vertical alleys of whitespace running the height of the block, are the column boundaries. Then the edges get snapped: if the table drew ruling lines, the region's borders lock onto the real lines, because a line the document actually drew is better evidence than a gap. Unruled tables fall back to their whitespace bounds.
That is deterministic. No model, no inference, no weights to download, just a few kilobytes of TypeScript. The same document always gives the same answer, and more importantly a wrong answer is explainable: you can point at the geometry that produced it.
Showing the boxes before the export
Detection like this is going to be wrong sometimes. It will merge two stacked tables, swallow a caption, or clip a narrow column. Most tools treat that as a fact you discover later, in the CSV, if you notice at all.
So the overlay is the product here, not a debug view. Every candidate region is drawn as a translucent box directly on the rendered page, live, before you click anything, dashed where the detector was unsure. A wrong boundary is something you see. And it is something you fix in place: drag the box's edge, and just that region re-parses. Discard a false positive outright. The bar is not "the detector is accurate," it is "a wrong guess is one drag away from right."
The small stuff is where extraction tools usually leak. The preview detects numeric columns and
sorts them by value, so 2, 10, 3 orders 2, 3, 10 instead of 10, 2, 3, and it parses
thousands separators, currency, percentages, and accounting negatives. Export quotes per RFC
4180, so a cell containing a comma or a line break survives. And the file carries a UTF-8 byte
order mark: three bytes, purely so Excel stops guessing the encoding from your locale codepage
and mangling every accent and currency symbol in the sheet.
The honest limit: scanned PDFs will not work, and cannot. Quarry reads coordinates, and a scan is a photograph of a page with no text layer under it. The rule of thumb is that if you can select the text in your PDF reader, Quarry can read it. If not, run OCR first and come back. Rotated and multi-column layouts get no special handling, and a table split across a page break comes out as two regions.
Try it
Open Quarry, drop in the densest PDF report on your disk, and watch the boxes land on the tables within a couple of seconds. Click one to see it parsed, sort a numeric column, drag an edge if the boundary clipped something, then hit Export CSV. Turn your wifi off first if you want to prove the point. The source is on GitHub.
This post is part of the build log: every app my automated factory ships gets written up here, honestly. Browse everything at apps.charliekrug.com. Comments are open below.
Loading comments…