PROJECT 06 • DAY 12 OF 90 • DOCUMENT WORKSPACE

FORMFLOW
PDF WORKSTATION.

A local-first, zero-cloud Document AI workspace turning native and scanned PDF forms into validated structured records via a Three-Pane Review Workstation — Document Queue, 160+ DPI coordinate viewer, and Editable Field Inspector.

Python 3.12pypdfium2 160+ DPIpdfplumberTesseract 5.4SQLite WAL41/41 Pytest
FormFlow Preview
WORKSTATION
Three-Pane Review
PYTEST SUITE
41 / 41 Passed
160+ DPI
C++ PDFium Rendering
<45 Chars
Auto Scanned-Page OCR
3-Pane UI
Queue • Canvas • Inspector
41 / 41
Pytest Tests Passed
01 / Overview

HUMAN-IN-THE-LOOP PDF FORM INTELLIGENCE AT ZERO CLOUD COST.

Cloud Document AI services charge per page and expose confidential forms externally. FormFlow runs 100% locally with coordinate provenance for every extracted value.

01

Three-Pane Workstation

Left Document Queue, Center 160+ DPI PDFium visual evidence viewer, and Right Editable Field Inspector with candidate history.

02

Smart Scanned-Page Trigger

Inspects selectable character count per page; pages below 45 chars automatically route through Tesseract v5.4 OCR.

03

Coordinate BBox Provenance

Preserves token bounding boxes (x0, top, x1, bottom) and alternative candidate values inside evidence metadata.

04

Type-Safe Validation

Normalizes dates to ISO-8601, strips currency noise into clean decimals, and verifies phone/email formatting rules.

05

SHA-256 + Key Collision Guard

Detects both exact binary PDF duplicates via SHA-256 and logical business-key duplicates across batches.

06

Sanitized JSON & CSV Exports

Guarded SQLite WAL persistence with audit logs plus formula-injection-safe JSON and CSV dataset outputs.

02 / Architecture

HOW IT WORKS.

PDFium/pdfplumber extracts spatial tokens, triggers Tesseract OCR when sparse, ranks field candidates, and persists to WAL SQLite.

STAGE 01

PDF Upload

SHA-256 duplicate & file safety check.

→
STAGE 02

Text / Render

pypdfium2 160+ DPI + pdfplumber coords.

→
STAGE 03

Auto OCR

Tesseract 5.4 triggered if chars < 45.

→
STAGE 04

Rank & Validate

Anchor matching + ISO/decimal checks.

→
STAGE 05

3-Pane Review

Human edit + formula-safe JSON/CSV.

03 / Screenshots

APPLICATION SCREENSHOTS.

Live screens captured from the running application. Click any image to view full size, or follow setup instructions in the GitHub repository.

04 / Technical Details

EXTRACTION & SAFETY SPECIFICATIONS.

Key modules, rules, safety checks, and automated test results documented in the repository.

Stage Engineering Rule Security / Accuracy Benefit
OCR Fallback Heuristic Page selectable char count < 45 chars Seamless native + scanned hybrid PDFs
Candidate Ranking Context label anchors + suffix heuristics Preserves runner-up evidence for review
PDF Rasterizer Google C++ PDFium at 160+ DPI Crisp glyph clarity for dense tables
Test Verification Parser, OCR, validator & export suite 41 / 41 Pytest Passed
05 / Tech Stack

CORE TECHNOLOGIES.

Frameworks, databases, visualization tools, and testing libraries used in FormFlow.

PDF RENDERING
pypdfium2 (C++ PDFium)
BBOX PARSING
pdfplumber
OCR FALLBACK
Tesseract OCR v5.4
INTERFACE
Streamlit Three-Pane UI
PERSISTENCE
SQLite 3 (WAL + FK)
VERIFICATION
Pytest (41/41 Passed)
06 / Next Steps

FUTURE ENHANCEMENTS.

Upcoming improvements planned for FormFlow.

Interactive click-to-highlight overlay rectangles directly on rendered PNG pages.
YOLO-based form zone classifier for multi-column registration templates.
Direct DuckDB and Apache Parquet analytical export targets.
Automated multi-language Tesseract traineddata manager.
Batch CLI daemon watching incoming scan drop directories.
Custom regex template builder UI for recurring enterprise forms.
OPEN-SOURCE PROJECT • GITHUB.COM/RAGURAMRRP

EXPLORE SOURCE & DOCS.

View the complete codebase, sample datasets, quick-launch scripts, and automated test suites on GitHub.