Skip to content

napi: add probe-doc.mjs for single-region detect_vector_grid checks#80

Open
abimaelmartell wants to merge 1 commit into
mainfrom
napi-probe-doc
Open

napi: add probe-doc.mjs for single-region detect_vector_grid checks#80
abimaelmartell wants to merge 1 commit into
mainfrom
napi-probe-doc

Conversation

@abimaelmartell

Copy link
Copy Markdown
Member

Summary

Generalizes the existing `probe-indent.mjs` pattern into `probe-doc.mjs` — a one-shot probe that calls `detectVectorGridInRegion` against a single PDF + region, useful for fast dev loops without the full bench harness or api round-trip.

Usage

cargo build --release && cd napi && bun run build:debug
node probe-doc.mjs <pdf-path> [page] [bbox] [dpi]

# examples
node probe-doc.mjs ~/Code/opendataloader-bench/pdfs/01030000000127.pdf 0
node probe-doc.mjs /tmp/foo.pdf 3 "50,100,560,700" 200

Output: `cells=N rows=R cols=C (Xms)` or `null`, plus echoed page/bbox/dpi for paste-friendly logs.

~5s round-trip vs ~30s for the full bench. Useful when iterating on `detect_rects.rs` and you want to confirm the binding behavior on a specific failing PDF before running the broader corpus.

Generalized one-shot probe — calls detectVectorGridInRegion against
a single PDF + region without spinning up the api or running the bench.
Useful for fast pdf-inspector dev loops:

  cargo build --release && cd napi && bun run build:debug
  node probe-doc.mjs <pdf-path> [page] [bbox] [dpi]

Output: cells/rows/cols and timing, or null when the region has no
vector grid. ~5s round-trip vs ~30s for the full bench harness.

Generalizes the existing probe-indent.mjs pattern so it works on
arbitrary PDFs, not just the multi-line indent fixture.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant