Skip to content

✨[Feat] Add local PDF OCR foundation - #99

Merged
maruson08 merged 1 commit into
v2.2from
feat/pdf-ocr-foundation
Sep 28, 2026
Merged

maruson08 merged 1 commit into
v2.2from
feat/pdf-ocr-foundation

Conversation

@maruson08

Copy link
Copy Markdown
Member

Problem

Secure Tools has local PDF rendering and local OCR, but no shared contract that safely composes them page by page. Future PDF-to-text and Searchable PDF work needs typed results, actual progress, cancellation, stale-result protection, and bounded resource use without introducing another renderer or OCR engine.

Result

  • adds a strict TypeScript PDF OCR service that reuses the existing same-origin PDF.js renderer and Tesseract service
  • processes selected or all pages sequentially at a deterministic 2x render scale
  • returns explicit { pageNumber, text } results with real render/OCR progress
  • cancels PDF rendering and OCR together, blocks stale callbacks, supports retry/source replacement, and releases each page canvas immediately
  • adds unit and browser integration coverage, including real one-page PDF OCR, multi-page/larger-page rendering, cancellation timing, and same-origin request checks
  • keeps this Sprint foundation-only: no public route and no searchable PDF generation

Validation

  • npm ci --ignore-scripts
  • npm run prepare:ocr
  • npm run typecheck
  • npm test
  • npm run build
  • node scripts/validate-build.mjs
  • node tests/ocr-smoke.test.mjs
  • git diff --check
  • PDF OCR browser harness: PASS: PDF OCR — HELLO
  • browser route, redirect, six-locale, theme, and console regression QA

Closes #98

@maruson08
maruson08 merged commit af361ef into v2.2 Sep 28, 2026
1 check passed
@maruson08 maruson08 mentioned this pull request Sep 28, 2026
@maruson08
maruson08 deleted the feat/pdf-ocr-foundation branch September 28, 2026 13:24
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