This folder contains two complementary scripts:
-
setup_ocr.sh– Installation wizard for OCRmyPDF, Tesseract OCR and language packs. -
ocr_gui.sh– Graphical (Zenity) frontend to OCR scanned PDFs with full navigation, settings, and batch processing.
They are designed to work as a single unit: run the setup wizard once, then use the GUI for daily OCR work.
Installs OCRmyPDF and Tesseract OCR on Fedora or Ubuntu/Debian.
-
Distribution Detection:: Automatically detects Fedora or Ubuntu/Debian and uses the correct package manager (
dnf/apt). -
Interactive Wizard:: Three-step guided setup: base install, language-pack selection, usage examples.
-
State Tracking:: On re-runs, skips the base installation and jumps straight to language-pack selection.
-
Health Check:: Detects missing components (e.g., after manual uninstall) and repairs them automatically.
-
30 Language Packs:: Supports English, German, French, Spanish, Russian, Chinese, Japanese, and many more.
-
--fullFlag:: Force re-run the complete wizard including base installation.
Package |
Fedora |
Ubuntu |
|
|
|
Tesseract |
|
|
Language packs |
|
|
Orientation & Script Detection |
|
|
GUI dialogs |
|
|
Scan cleanup |
|
|
A Zenity-based GUI wrapper around ocrmypdf that provides a complete step-by-step workflow.
Mode selection → File/Folder picker → Language selection
→ Text mode → Naming mode → OCR processing → Result dialogEvery step has a Back button; cancel on the main screen exits.
-
Single File & Batch Mode:: Process one PDF or a whole folder at once.
-
Language Selection:: Dynamically reads installed Tesseract languages (dynamically detected at startup).
-
Text Mode::
--skip-text(faster) or--force-ocr(rebuild text layer) with optional "Remember" setting. -
Output Naming:: Three options — replace original, add
_OCRsuffix, or auto-indexed numbers (_1,_2, …). -
Remembered Settings:: Text mode and naming choices can be saved to
ocr_settings.json(lives next to the script, manageable via Settings window). -
Batch Processing:: Processes all unprocessed PDFs in a folder with a progress bar.
-
Error Logging:: Timestamped debug output visible directly in the terminal.
-
Navigation:: "OCR another file" restarts the workflow at the file picker.
cd Program_Setups/OCR
./ocr_gui.shOptional: enable full bash trace for debugging:
OCR_DEBUG=1 ./ocr_gui.shInstalled by setup_ocr.sh:
-
zenity– GUI dialogs -
ocrmypdf– OCR engine -
tesseract– OCR backend -
tesseract-osd– Orientation & Script Detection -
unpaper– Scan image cleanup (for--cleanflag) -
python3– JSON settings management -
bash≥ 4.0 – associative arrays andmapfile
Accessed from the main menu. Shows all configurable options:
-
Text handling mode –
--skip-textor--force-ocr(checkbox, rememberable) -
Naming: Replace original file – overwrites the source PDF
-
Naming: _OCR suffix – appends
_OCRto the filename (default) -
Naming: Index number – creates
filename_1.pdf,filename_2.pdf, …
Naming modes are mutually exclusive: only the last checked one is kept on Save.