Case studyDocument ProcessingQ4 2025 · 2 monthsOCR & NLP

VisionOCR

Convert your scanned PDFs into editable Word documents with 99 %+ accuracy — formatting preservation, smart cache and support for 60+ languages thanks to Google Cloud Vision API.

Discuss a similar project

Réponse courte

VisionOCR is a Python CLI tool built to turn scanned PDFs into Word documents (.docx) faithful to the original. Through a 4-step pipeline powered by Google Cloud Vision API, it detects text with over 99% accuracy, analyzes formatting (fonts, alignments, spacing) and rebuilds a Word document that preserves the original layout. A smart SHA-256 cache with a 30-day TTL eliminates redundant API calls, bringing the cost of reprocessing down to zero.

Context

Context & Challenges

Why traditional PDF-to-Word conversion solutions fall short

Converting scanned documents into editable files remains a major challenge for companies and professionals. Traditional OCR tools offer insufficient accuracy, lose the original formatting and bill every API call with no caching mechanism — a costly, imprecise and time-consuming process.

!

Limited OCR accuracy

Traditional OCR tools offer 85-90% accuracy, insufficient for professional, old or low-resolution scanned documents.

!

Systematic formatting loss

Fonts, alignments, text sizes and spacing are rarely preserved during conversion, requiring time-consuming manual re-layout.

!

Insufficient multilingual support

Most tools only handle a few languages correctly, limiting their use in an international or multilingual context.

!

Uncontrolled API costs

Every call to a cloud OCR service costs money, and without a built-in caching mechanism, reprocessing needlessly multiplies the bill.

Functional scope

Scanned documents: books, invoices, administrative files, technical manuals. Multi-page processing with selection by range or list. Support for 60+ languages with automatic detection. Configurable resolution from 300 to 600+ DPI.

Key constraints

Target OCR accuracy > 99% on any type of document · Faithful formatting preservation (fonts, styles, alignments) · Controlled costs via a smart cache with a 30-day TTL · Cross-platform compatibility: Linux, macOS, Windows.

Objectives

Objectives & Scope

Three strategic axes for professional-grade PDF-to-Word conversion

Strategic objective

Democratize professional OCR: make superior-quality PDF-to-Word conversion accessible through a simple, open-source and extensible CLI tool.

KPI: 99%+ OCR accuracyKPI: 60+ languages

Operational objective

Automate the full pipeline — from raw PDF to formatted Word document — with batch processing and a smart cache.

KPI: 2-3 s per pageKPI: 30-day cache TTL

Technical objective

Control Google Cloud Vision API costs through a persistent SHA-256 disk cache and automatic compression of images > 20 MB.

KPI: 1,000 free pages/monthKPI: $1.50 / 1,000 pages
Stack

Tech Stack

The technologies and libraries at the heart of VisionOCR

OCR & Vision

Google Cloud Vision APIgoogle-cloud-vision 3.7google-auth 2.29

PDF processing

pdf2image 1.17Pillow 10.3poppler-utils

Word generation

python-docx 1.1Custom stylesFormatting preservation

Analysis & ML

numpy 1.26scikit-learn 1.4DBSCAN clustering

CLI & Configuration

Click 8.1python-dotenv 1.0loguru 0.7tqdm 4.66

Performance & Cache

diskcache 5.6joblib 1.4ThreadPoolExecutor

Differentiating pattern — Smart SHA-256 cache: unlike traditional OCR tools that bill every processing run, VisionOCR uses a SHA-256 hash of each image's content to create a unique cache key. OCR results are stored locally via diskcache with a 30-day TTL, eliminating redundant API calls. The result: reprocessing cost drops to zero, and processing time for already-analyzed documents is instant.

Architecture

Architecture Diagrams

An overview of the application and the OCR processing pipeline

APPLICATION ARCHITECTURE — VISIONOCRUSERTerminal / CLICommand lineORCHESTRATORmain.pyClick CLICONFIGURATIONconfig.pyCentral configurationMODULE 1PDFProcessorpdf_processor.pyMODULE 2VisionAPIClientvision_api_client.pyMODULE 3FormatAnalyzerformat_analyzer.pyMODULE 4DocxBuilderdocx_builder.pyPDF Inputpdf/input/Google CloudVision APIExternal OCR servicediskcacheLocal SHA-256 cacheDOCX Outputpdf/output/Python moduleExternal service / I-O
Results

Results, Gains & ROI

Measured gains in document conversion and processing

99%+
OCR accuracy
Google Cloud Vision API
2-3 s
Per page (300 DPI)
With parallelization
60+
Languages supported
Automatic detection
$0
Cache hit cost
SHA-256 cache · 30-day TTL
IndicatorTraditional OCRWith VisionOCRGain
OCR accuracy85-90%99%++10 to +15 points
Formatting preservationNone or partialFonts, alignments, spacingFaithful formatting
Language support5-10 languages60+ languages with auto detection×6 to ×12
Reprocessing costSame as first processing$0 (SHA-256 cache)−100%
InterfaceComplex GUISimple, scriptable CLIAutomatable
Time per pageVariable, often > 10 s2-3 s (300 DPI)~×4 faster

Qualitative gains

💡

Open Source

Free code under MIT license. Extensible, auditable, community-driven.

🖥️

Cross-platform

Compatible with Linux, macOS and Windows. Automatic installation scripts.

Smart cache

Cuts API costs by 100% on reprocessing thanks to the SHA-256 hash.

🎨

Faithful formatting

Preserves the fonts, styles, alignments and spacing of the original document.

💻

Scriptable CLI

Integrates into any automated pipeline. Native batch processing.

📈

Advanced logging

Loguru with rotation, verbosity levels (-v, -vv, -vvv) and API statistics.

How about we start by talking?

No pushy salespeople. No 12-step form. Just 30 minutes to understand your situation and see if we can help. First conversation free, no strings attached.