Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ jobs:
sudo apt-get install -y tesseract-ocr tesseract-ocr-eng poppler-utils
tesseract --version
pdftoppm -v
node --test integrations/javascript/*.test.mjs
node --test --test-concurrency=1 integrations/javascript/*.test.mjs

python:
name: Python ${{ matrix.python-version }} bindings and wheel
Expand Down
34 changes: 34 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Changelog

## Unreleased: 0.4.0-dev

### Added

- Schema 0.18 page geometry and pixel-to-PDF transforms preserve raw PDF
coordinates through quarter-turn OCR, CropBox and UserUnit handling.
- Schema 0.19 page and region route evidence explains bounded vector candidates
and their regional OCR requests. Public records retain counters, limits and
exact candidate bounds, including candidates sharing a bitmap crop.
- JavaScript adapters validate the new contracts and expose coordinate mapping
helpers while preserving text, chunk origins and source locators.
- Small reproducible outlined-text fixtures and negative controls cover native
clipping, transformed Forms, rules, highlights, logos and resource refusal.

### Fixed

- Rotated OCR preserves recognized word order. Inferred tables on rotated pages
remain withheld until their topology is qualified.
- Partially clipped native spans no longer suppress outlines outside their clip.
- Exhausted native coverage accounting abstains instead of publishing zero
coverage as complete evidence.
- OCR text elsewhere in a reused bitmap crop cannot mark a disjoint vector
candidate recovered. Recovery remains text availability, with completeness
unverified.

### Changed

- CI runs adapter test files serially to avoid process-start deadline contention
observed during concurrent local verification.
- Vector collection and classification retain explicit work bounds. These
bounds exclude initial PDF decompression and do not establish a whole-process
memory limit.
43 changes: 40 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,9 @@ The minimal specialist config shape is a JSON object with optional `ocr`,
`enabled`, `executable`, `args`, `rasterizer_executable`, `crop_dpi`,
`crop_padding_points`, `crop_grayscale`, and `timeout_ms`. Formula invocation
is opt-in and model-neutral; no recognizer package is bundled. Memory-opened
documents and rotated pages produce explicit crop-stage outcomes rather than
silently invoking a text-only fallback.
documents, invalid geometry and unsupported rotations produce explicit
crop-stage outcomes. The development schema `0.18` maps declared quarter turns
through shared crop transforms; scan orientation detection is separate.

The document manifest is the top-level intelligence summary: input SHA256,
parser/schema versions, page count, encrypted/corrupt flags, route counts,
Expand Down Expand Up @@ -669,7 +670,13 @@ and ruling lines, invokes OCR only for scanned routes, then reconciles native,
OCR, table, formula, and form spans with typed provenance.

The versioned JSON, artifact JSONL, and streaming JSONL schema is currently
`0.17.0`, with parser build identity `0.4.0-dev` after the `v0.3.0` release.
`0.19.0` in local development, with parser build identity `0.4.0-dev` after the
`v0.3.0` release. Schema `0.17.0` landed in [PR #6](https://github.com/Tom-R-Main/pdf-parser/pull/6)
at `9cac608`, with all six CI checks green. Schemas `0.18` and `0.19` are locally
checked and committed on `codex/coordinate-vector-ocr`; remote CI and merge
remain separate. The `0.19` vector-routing continuation's 23 outlined-text and
negative-control fixtures, 13 real CLI/SDK tests and both JSONL readers are
qualified in the [implementation evidence](docs/parser-host-implementation-plan.md#bounded-vector-routing-019-locally-checked).
Every emitted record carries a `provenance` envelope with document and
source identity, input hash context, artifact id, page/bbox, source kind,
confidence, related span/block/chunk ids, route trace ids, and route reasons.
Expand All @@ -692,6 +699,36 @@ Schema `0.17.0` adds content-stream and Form invocation scope to spans.
ActualText and classified text boundaries survive adaptive reconstruction; Form
text uses scoped resources and transformed geometry. Native and adaptive text
quality gates run against the same born-digital and hard-font floors.
Schema `0.18.0` adds nullable page geometry and OCR/formula pixel transforms for
declared quarter-turn pages. Source bboxes remain raw, unrotated PDF user-space
coordinates; UserUnit determines their physical size. Display geometry uses the
effective CropBox in physical points, while rasterization uses MediaBox and
retains bounded crop budgets. Legacy PageInfo dimensions and the manifest's
`display_transform:null` remain compatible. These mappings do not detect scan
orientation or establish visual completeness.
Rotated OCR retains recognized word order; inferred tables on those pages are
not promoted to table artifacts until their topology is qualified.
Schema `0.19.0` adds nullable vector evidence to page and region routes. Bounded
painted-path collection and geometric grouping can request regional OCR for
unexplained vector contours. Rules, simple boxes, native-accounted shapes and
isolated symbols can be withheld. The collector caps retained shapes at 512,
segments per path at 512, operators at 100,000, cumulative vector-lexer input at
8 MiB, graphics stack depth at 32, Form invocations at 256 and candidate regions
at 64. Page summaries retain operator and byte counters. These lexer bounds
exclude initial PDF decompression and do not establish whole-process memory
limits. Native accounting uses rectangle unions capped at 64 intersections per
coverage query and 1,000,000 native-span checks during page classification;
candidate-merge coverage has its own bounded check budget. Exhaustion produces
partial evidence and abstention.
Partial or limited evidence remains explicit. Grouping uses known display axes;
candidate bboxes stay in raw PDF coordinates. Exact candidate bounds can be
retained within a larger image OCR route to avoid duplicate crops. These
candidates require retained OCR text intersecting the exact candidate extent
before recovery is reported; recognized text elsewhere in the bitmap crop does
not qualify. Recovery and merged route bounds leave completeness unverified.
Vector candidates do not establish recognized glyphs, final visibility or
complete coverage, and use the existing
OCR engine and crop budgets.
Host adoption remains explicit; accepted schema families and parser/compiler
pins must be updated together.

Expand Down
4 changes: 4 additions & 0 deletions benchmark/eval/vector_routing/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Small generated correctness fixtures are intentionally versioned here.
!*.pdf
!font-license.txt
!truth/*.txt
Binary file added benchmark/eval/vector_routing/border.pdf
Binary file not shown.
Binary file added benchmark/eval/vector_routing/chart-labels.pdf
Binary file not shown.
Binary file added benchmark/eval/vector_routing/clipped-out.pdf
Binary file not shown.
Binary file added benchmark/eval/vector_routing/compound-fill.pdf
Binary file not shown.
Binary file added benchmark/eval/vector_routing/dense-graphics.pdf
Binary file not shown.
Binary file added benchmark/eval/vector_routing/filled-box.pdf
Binary file not shown.
57 changes: 57 additions & 0 deletions benchmark/eval/vector_routing/font-license.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
Bitstream Vera Fonts Copyright

The fonts have a generous copyright, allowing derivative works (as
long as "Bitstream" or "Vera" are not in the names), and full
redistribution (so long as they are not *sold* by themselves). They
can be be bundled, redistributed and sold with any software.

The fonts are distributed under the following copyright:

Copyright
=========

Copyright (c) 2003 by Bitstream, Inc. All Rights Reserved. Bitstream
Vera is a trademark of Bitstream, Inc.

Permission is hereby granted, free of charge, to any person obtaining
a copy of the fonts accompanying this license ("Fonts") and associated
documentation files (the "Font Software"), to reproduce and distribute
the Font Software, including without limitation the rights to use,
copy, merge, publish, distribute, and/or sell copies of the Font
Software, and to permit persons to whom the Font Software is furnished
to do so, subject to the following conditions:

The above copyright and trademark notices and this permission notice
shall be included in all copies of one or more of the Font Software
typefaces.

The Font Software may be modified, altered, or added to, and in
particular the designs of glyphs or characters in the Fonts may be
modified and additional glyphs or characters may be added to the
Fonts, only if the fonts are renamed to names not containing either
the words "Bitstream" or the word "Vera".

This License becomes null and void to the extent applicable to Fonts
or Font Software that has been modified and is distributed under the
"Bitstream Vera" names.

The Font Software may be sold as part of a larger software package but
no copy of one or more of the Font Software typefaces may be sold by
itself.

THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL
BITSTREAM OR THE GNOME FOUNDATION BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL,
OR CONSEQUENTIAL DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF THE USE OR INABILITY TO USE THE FONT
SOFTWARE OR FROM OTHER DEALINGS IN THE FONT SOFTWARE.

Except as contained in this notice, the names of Gnome, the Gnome
Foundation, and Bitstream Inc., shall not be used in advertising or
otherwise to promote the sale, use or other dealings in this Font
Software without prior written authorization from the Gnome Foundation
or Bitstream Inc., respectively. For further information, contact:
fonts at gnome dot org.
Binary file added benchmark/eval/vector_routing/fused-panel.pdf
Binary file not shown.
Loading
Loading