OcrFlow is a lightweight, offline-first OCR pipeline for converting scanned images into searchable PDFs and structured Markdown.
After downloading and extracting the release, unblock files (unsigned binaries):
Get-ChildItem . -Recurse | Unblock-File.\OcrFlow.exe "<INPUT_DIR>"-
<INPUT_DIR>– directory containing images (PNG / JPG / PDF) -
default behavior:
- PDF generation enabled
- merge enabled
- Markdown enabled
- result summary enabled
-
output files are created in the input directory (unless
--outputdiris used)
You can also pass input directory explicitly:
.\OcrFlow.exe --source "<INPUT_DIR>".\OcrFlow.exe "<INPUT_DIR>"
.\OcrFlow.exe --source "<INPUT_DIR>"- positional argument or
--source <DIR> - directory must exist
.\OcrFlow.exe "<INPUT_DIR>" --lang eng--lang <LANG>– OCR language(s), e.g.eng,pol,eng+pol- default:
eng
PDFs are generated and merged into a single file.
.\OcrFlow.exe "<INPUT_DIR>" --nopdf.\OcrFlow.exe "<INPUT_DIR>" --onlypdf- Generates only PDF
- Skips Markdown generation
--nopdfand--onlypdfcannot be used together
Markdown summary is generated automatically.
.\OcrFlow.exe "<INPUT_DIR>" --nomarkdown.\OcrFlow.exe "<INPUT_DIR>" --onlymarkdown- Generates only Markdown
- Skips all PDF generation
- Slightly faster for large batches
--nomarkdownand--onlymarkdowncannot be used together
.\OcrFlow.exe "<INPUT_DIR>"All pages are merged into a single PDF.
.\OcrFlow.exe "<INPUT_DIR>" --nomerge- Generates separate PDFs (one per page)
.\OcrFlow.exe "<INPUT_DIR>" --outputdir "C:\Output"- Overrides default output location
- Input directory remains unchanged
.\OcrFlow.exe "<INPUT_DIR>" --pdf-name-prefix scan_ --md-name-prefix text_--pdf-name-prefix– prefix for generated PDF files--md-name-prefix– prefix for generated Markdown files
By default, OcrFlow generates a result summary file:
result-YYYY-MM-DD_HH-mm.md
Disable it with:
.\OcrFlow.exe "<INPUT_DIR>" --noresult.\OcrFlow.exe "<INPUT_DIR>" --throwForces an exception to test crash handling and diagnostics.
.\OcrFlow.exe "C:\Users\{user}\Scans" --lang pol --onlymarkdown --outputdir "C:\Output"flowchart TD
A["Input images<br/>PNG / JPG / PDF"] --> B["Per-page pipeline"]
subgraph PerPage["Per-page pipeline"]
B --> C["OCR<br/>Tesseract"]
C --> D["Build searchable PDF<br/>image + text layer"]
C --> E["Extract raw text"]
end
D --> F["Temporary PDF files"]
E --> G["Collected page texts"]
subgraph Global["Global pipeline"]
F --> H{"Merge enabled?"}
H -->|Yes| I["Merge PDFs"]
I --> J["Final PDF output"]
H -->|No| L["Keep per-page PDFs"]
G --> M{"Markdown enabled?"}
M -->|Yes| N["Text processing pipeline"]
N --> O["Markdown formatter"]
O --> P["Markdown output"]
M -->|No| Q["Skip Markdown"]
end
OcrFlow uses a two-level pipeline architecture:
Executed once per page:
- Image loading & normalization
- OCR (Tesseract)
- Searchable PDF generation
- Raw text extraction
Executed once per run:
- Optional PDF merge
- Text post-processing
- Optional Markdown export
- Optional result summary
Each step is explicit, composable, and independently testable.
- Offline OCR (no cloud, no telemetry)
- Searchable PDF output
- Structured Markdown summaries
- Deterministic pipeline execution
- Fine-grained CLI control
- Clear separation of concerns
- Offline-first
- Predictable output
- Explicit control flow
- Low runtime complexity
- Easy extensibility
- Archival scanning
- Technical documentation
- Engineering records
- Offline document processing