If you’ve ever wired a recurring PDF report (fee schedule, tariff update, public catalog, regulatory bulletin) into n8n or Make, you’ve probably seen the same failure mode:
- Plain text / Markdown extractors flatten multi-column tables into single lines (
"Tables come out as text lines"). - Passing every page through an LLM every week gets expensive and introduces silent numeric hallucinations.
- Even when extraction works, you still have to build custom diff logic just to answer: "Which table rows changed since last month’s PDF?"
Before writing a single line of production code for a lightweight text-first parser + change watcher (no OCR, no monthly SaaS lock-in), I’m running an open pre-build validation until December 19, 2026.
If you deal with recurring public, non-confidential text-based PDFs, I’d genuinely appreciate 2 minutes of feedback on the open RFC issue:
https://github.com/stqnbapxao-source/structmint-b2b-automation-kit/issues/1
Specifically looking for:
- One public sample PDF URL where current parsers mangle tables.
- What clean JSON/CSV table or row-diff output you’d actually feed into n8n/Make.
- Monthly document volume and what pay-per-use price feels reasonable (e.g.,
$0.005/PDF,$0.002/table, or$0.01/report-diff).
(Full disclosure: Pre-build research only — no product or checkout exists. If existing low-cost tools already cover this well enough, I’ll close the RFC and skip building it.)
Top comments (14)
The row-keyed JSON point in the thread is the right output shape — and the question underneath it (infer the key or let users pass one) has a checkable answer: infer from a column whose values are unique and stable across two consecutive issues, and fall back to a user-supplied list when no column qualifies. The test that decides is running the diff on two real consecutive issues and counting false 'changed' rows — if the inferred key produces phantom changes, it's not a key.
Three failure modes your sample set needs to cover, from the benchmark I run against PDF-to-Markdown tools:
On samples: I have an 11-fixture benchmark set (rotated pages, scanned 3-pager, multi-page tables, merged headers) with per-page expected outputs — happy to share the fixture PDFs if you want them as your five. What format would be most useful, the raw PDFs or the per-page expected row counts alongside?
That 3-point failure checklist is gold — especially #3 (a rotated or scanned page silently triggering phantom row deletions in a diff unless gated by a per-page char-count floor).
We would genuinely love to test against your 11-fixture set. Both the raw PDFs AND the per-page expected row counts would be hugely valuable so we can wire them directly into our automated regression benchmark and measure recall honestly (and fix split-row page breaks + source-preserving header dedupe + rotated-page detection where we fall short).
Feel free to drop a repo link or attachment here or on
https://github.com/stqnbapxao-source/structmint-b2b-automation-kit/issues/1— happy to share back the exact per-fixture pass/fail numbers once we run it!Thanks — happy to share the set, with one honest caveat about what it actually is.
The raw PDFs are public here: github.com/kamalmosadegh/pdf-slice... — 16 files. The ones most useful for your regression suite: merged_table.pdf (merged 'Quarterly Sales Report' header — the merged-group case), table.pdf (Product/Price/Stock, 3 rows), scanned.pdf (3-page scan, OCR route), columns.pdf (two-column reading order), large.pdf (120 pages — the split-row/page-break case).
The caveat: the expected values in tests/references.json are expected text/cell values, not per-page row counts — the set was built for text-extraction recall (11-fixture comparison vs MarkItDown 0.1.9, pooled recall 0.61), not table-row regression. So you can take the PDFs as-is, but the expected row counts per fixture are yours to add; the references file tells you what text each fixture must contain, not how many rows it has.
On the rowKeyColumns question: first-column inference is the right default until column 1 is a merged category label — that is the case where it silently invents false-changed rows. The check I would run before trusting any inference: two consecutive issues of the same recurring table, count the false-changed rows; if it is not zero, the key column is wrong.
Keen to see your per-fixture pass/fail numbers once you run it.
Ran all 16 fixtures from
pdf-slice/tests/fixturesagainstreferences.json— thanks for sharing such a sharp test suite. It immediately exposed 4 real gaps in v1, which we fixed and just shipped in v1.1 (512 MB, text-first, still intentionally zero-OCR).Here are the honest Before (v1) → After (v1.1) per-fixture numbers on your exact 16 files:
table.pdfsectionTitle: "Fruit price list", 3 rowsmerged_table.pdf["Quarterly Sales Report","column_2","column_3"]sectionTitle, real headers["Product","Price","Stock"]columns.pdfcol1_before_col2: false)col1_before_col2: true)pypdfium2logical ordermultilingual.pdfpypdfium2large.pdf(120p)white.pdfblack.pdfnexus_a.pdf/nexus_b.pdfempty_grid.pdfminCharsPerPageForDiff=25empty.pdfscanned: [1]scannedPagesDetected: [1](PASS)scanned.pdf(3p)scannedPagesDetected: [1,2,3],reportDiff.diffGated: true, suppresses phantom deletions & preserves prior watch baselinelocked.pdfPdfiumErrorPdfPasswordProtectedError(PASS)corrupt.pdf,garbage.bin,zero.pdfPdfiumErrorPdfCorruptError(PASS)Honest Scorecard
scanned.pdf):0/40OCR words because the Actor intentionally stays at 512 MB with zero OCR engine; the main upgrade for watch pipelines is that scanned or 0-text rotated pages can no longer emit falserowsRemovedCountalerts or overwrite a healthy baseline.If you ever want to poke at v1.1 directly on Apify (runs on Free tier, ~$0.00015 compute at 512 MB): apify.com/structmint/pdf-structure... — and I'm curious how
pdf-slicehandles thescanned.pdfOCR tiering vs memory budget in your setup!That's a proper scorecard — 15/16 with the one miss named as a limit, not hidden. And shipping the four fixes the same day the fixtures exposed them is exactly what a benchmark set is for.
On your question — pdf-slice tiers per page, not per file, and it has no memory cap to fit because it's a local CLI: it streams one page at a time, so memory scales with the page, not the document. The tiering rule is a per-page char-count floor: 50 chars/page (200 for image-heavy pages). A page under the floor goes to the OCR path; a page at 0 chars is flagged scanned. On my 11-fixture benchmark against MarkItDown 0.1.9 the OCR route fired exactly once — the 3-page scan — and the low-confidence bucket fired exactly once, on the empty PDF. Nine clean fixtures never touched either.
Your diffGated flag is the same shape as pdf-slice's low-confidence bucket: when a page has no usable text, suppress the diff instead of emitting phantom row deletions. The one case I'd check on your side: does diffGated also fire on a rotated 0-text page? My rotated-page fixture reads 0 chars until detect_vertical runs, then recall goes 0.00 → 1.00 — a page that looks empty but has recoverable text. If the gate keys only on char count, that page is safely gated but never recovered. Worth a rotation pre-check before the gate, so scanned and rotated take different paths.
Great catch — testing that exact case just caught a nasty table-orientation bug we hadn't seen yet.
Here is what happened when we tested all 6 orthogonal rotation cases (
/Rotate90°/180°/270° and canvas-transformed vertical text 90°/180°/270°):pypdfium2before theminCharsPerPageForDiffgate, text-bearing rotated pages already recovered76/76chars and did not falsely tripdiffGated. (Only a genuinely empty/scanned rotated page trippedscannedPagesDetected+diffGated: true.)pdfplumberreturned bordered tables transposed (['002', '001', 'Code']) at/Rotate=90/ canvas270°, and transposed + spelled backwards (['etaR', '05.21', '00.91'],'A tegdiW') at/Rotate=270/ canvas90°and180°!We just shipped both fixes live to Apify Cloud:
pypdfium2ever returns below the char floor on a page with non-upright glyphs, we reconstruct reading-order text from the glyph affine matrices before the gate — so rotated text-layer pages recover cleanly while 0-char rotated scans still route todiffGated: true.0° / 90° / 180° / 270°): Detects the dominant text-baseline vector inside each table bbox, reconstructs cell strings along true reading order (no naive string reversal, so upright RTL Persian inmultilingual.pdfstays untouched), and rotates the grid back upright (["Code", "Item", "Rate"]across all 6 rotation cases, 0 regression across your 16pdf-slicefixtures).Appreciate the per-page tiering breakdown (
50chars /200image-heavy floor) — if that rotated-page fixture is in another public repo/branch, happy to run it through the live Actor too!Thank you for running all six — that settles my question cleanly: diffGated fires only on genuinely 0-char rotated pages, and text-bearing rotated pages recover through the glyph-matrix path before the gate. The bigger finding is the table one: the text gate passed while pdfplumber transposed the tables silently. A green text check hiding a wrong table is exactly the silent-failure class this thread is about — worth a table-shape assertion next to the char-count gate (row count plus first-cell value per page), so a transposed grid fails loudly instead of indexing wrong. And good call keeping upright RTL untouched; a naive string reversal would have broken Persian.
One cross-check from my side: I'll run the same six rotation cases through pdf-slice's table path and post back whether any orientation transposes there too. If it holds everywhere except pdfplumber, it's one library's geometry assumption; if it breaks in both, it's a more general lesson about reading order. Thanks for turning the question into a shipped fix.
That transposed-table catch is the real find — and the nastier failure mode of the two. The text gate passing while the grid silently transposes means recall stays green while the structure is wrong, and a diff built on that table would report phantom row changes that never happened. Good that the fix keys on the dominant baseline vector instead of naive string reversal — that is exactly what keeps the upright RTL Persian in multilingual.pdf untouched.
On the fixture question, one honest correction: the rotated-page case is not a standalone file in the public tests/fixtures set. The 16 files are table, merged_table, columns, multilingual, scanned, large, empty, empty_grid, white, black, nexus_a/b, locked, corrupt, garbage.bin and zero — no rotated variant. The 0.00 → 1.00 number came from a rotated variant in the MarkItDown benchmark, not a committed fixture. The closest public stand-in is table.pdf itself rotated 90°: same 12-cell grid, expected values already in references.json (table_cells). If a committed rotated variant of table.pdf would help, I can add one to the fixtures; or run the live Actor against a 90° rotation of table.pdf and compare the grid before and after the affine fix.
One check I'd still run on the affine reorientation: a mixed-direction table — upright Latin headers with RTL cell values in the same grid. The baseline vector is Latin-dominated, so the RTL cells should ride along untouched, but that is the case where a rotation fix can quietly re-order cell contents. multilingual.pdf doesn't cover it — its Persian is prose, not a table.
Just ran both checks you suggested — super clean signal on both:
Your
table.pdfrotated 90° and 270° (/Rotateset viapypdfium2):headers: ['Product', 'Price', 'Stock'], rowsApple / $1.20 / 120,Banana / $0.80 / 200,Cherry / $2.50 / 75,scanned: [],diffGated: false).table.pdfvariant topdf-slice/tests/fixtureswould honestly be a great public benchmark for the whole PDF ecosystem — lots of libraries silently transpose there.Mixed-direction table (upright Latin headers
['Code', 'Product', 'Price']+ Persian RTL cells'سلام دنیا'&'فارسی تست'):angle=0): Bypassed affine reorientation completely (angle == 0short-circuit) and returned exact strings ('سلام دنیا','فارسی تست').angle=270baseline): Recovered upright headers and exact Persian cell strings cleanly too.multilingual.pdf),pypdfium2prose handles bidi shaping cleanly whilepdfplumbercell text still follows raw glyph-x order unless normalized — definitely worth keeping an eye on if a visual-order mixed RTL table fixture turns up.Really curious to see how
pdf-slice's table path behaves across those 6 rotation orientations too — and good tip on adding a table-shape regression assertion next to the char-count gate!Ran the six through pdf-slice's table path — current main (commit f68b63a, extract.py 1.1.0), same table.pdf, expected grid Product/Price/Stock × Apple/$1.20/120, Banana/$0.80/200, Cherry/$2.50/75. 0/6 come back correct, and it splits into two failure modes:
So it breaks in both, not just pdfplumber — the difference is where: pdfplumber transposes and reverses characters, pdf-slice transposes without reversing but loses the /Rotate grids entirely. The fix on my side is the same shape as yours: a rotation pre-check before the table path, or a table-shape assertion (row count + first-cell value) next to the char-count gate so a transposed grid fails loudly instead of indexing wrong.
The mixed-direction result is the clean part — both checks passing with the RTL cells untouched is exactly what the baseline-vector fix should do. And your visual-order RTL caveat is real: pdfplumber cell text follows raw glyph-x order there, so a visual-order mixed RTL table fixture would be worth having if one turns up.
Thanks for running all 6 through
pdf-sliceand reporting the exact split — that's one of the clearest cross-library diagnoses I've seen on PDF table extraction.I just reproduced your exact Form XObject setup against your
table.pdf(placing page 0 onto a/Rotate 0blank page with90° / 180° / 270°affine transforms viaFPDF_NewXObjectFromPage+FPDFPageObj_Transform) alongside/Rotate 90° / 180° / 270°onpdf-structured-tables-watchv1.1:/Rotate 90° / 180° / 270°:3/3PASS (headers: ['Product', 'Price', 'Stock'], exact 3 rows,scanned: [])90° / 180° / 270°(/Rotate 0):3/3PASS (headers: ['Product', 'Price', 'Stock'], exact 3 rows,scanned: [])The contrast you surfaced —
/Rotatefailing loudly with empty cells vs. rotated Form XObjects (/Rotate 0) silently transposingStock / 120 / 200 / 75into the header row with zero warning — is a textbook case for putting a table-shape sanity check (or glyph baseline-angle check) right next to the char-count gate.Really appreciate you cross-testing this in the open. If you ever do publish a rotated
table.pdf(or a visual-order mixed RTL fixture) intopdf-slice/tests/fixtures, drop a note — happy to keep running regression passes against it.Thanks for the clean reproduction — 6/6 on your side against 0/6 on pdf-slice's table path is exactly the contrast worth having in the open: /Rotate fails loudly with empty cells, the Form XObject cases fail silently with a transposed grid. I'll add a committed rotated variant of table.pdf to the fixtures and post the link here when it's in — and I'll keep an eye out for a visual-order mixed RTL table fixture, since that's the case neither of us has covered yet. Keen to see your regression numbers once the rotated variant lands.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.