Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

v1.6.0 OCR Language Support, Batch Conversion & GUI Redesign

Latest

Choose a tag to compare

@M1ck4 M1ck4 released this 28 Mar 01:24
17b2cff

v1.6.0 — OCR Language Support, Multi-File Batch Conversion & GUI Redesign

This is a feature release that adds meaningful new capabilities to both the GUI and CLI, resolves several reported bugs, and delivers a visual overhaul of the desktop interface. Version 1.6.0 makes pdfmd substantially more useful for non-English documents, multi-file workflows, and anyone who spends real time in the GUI.


Why This Matters

PDF conversion tools that only handle English, process one file at a time, and silently overwrite output create friction in professional workflows. This release removes all three of those limitations while also fixing bugs that interrupted conversions and crashed the GUI on startup.


What's New

🌐 OCR Language Selection

Tesseract supports over 100 languages, but until now pdfmd always defaulted to English. This release adds full language control:

  • GUI: An editable dropdown next to the OCR mode selector, pre-loaded with 17 common languages (English, German, French, Spanish, Japanese, Chinese Simplified/Traditional, Korean, Arabic, and more)
  • CLI: New --lang flag accepting any Tesseract language code
  • Combined languages: Type eng+fra or deu+eng for multi-language documents
  • Saved with profiles: Your language choice persists across sessions and is included in custom profiles
  • Works with both engines: Language is passed through to Tesseract and OCRmyPDF

CLI example:

pdfmd vertrag.pdf --ocr auto --lang deu
pdfmd bilingual.pdf --ocr tesseract --lang eng+fra

📁 Multi-File Batch Conversion (GUI)

The GUI now supports selecting and converting multiple PDFs in a single run:

  • Multi-select in Browse: Ctrl+click or Shift+click to pick multiple files
  • Automatic folder output: When multiple files are selected, the output field switches to a folder picker
  • Per-file naming: Each PDF produces its own <filename>.md in the output folder
  • No accidental overwrites: If report.md already exists, output is saved as report_1.md, report_2.md, etc.
  • Scaled progress: The progress bar tracks across all files with [1/5], [2/5] headers in the log
  • Resilient batch processing: If one file fails, the rest continue; a summary shows successes and failures

🎨 GUI Redesign — Obsidian-Inspired

The entire GUI has been rebuilt for clarity, readability, and visual quality:

  • Layered dark theme: Background (#1e1e1e), cards (#252525), and inputs (#2d2d2d) create visible depth instead of a flat dark mass
  • Visible card borders: Subtle #363636 edges define section boundaries
  • Grouped options with separators: OCR settings, output toggles, structural toggles, and tuning knobs are visually separated by horizontal rules
  • Accent button: The Convert button uses #7b6cd9 purple with white text — clear primary action
  • Inset log area: The console panel has a recessed border and darker background, reading as an embedded terminal
  • Themed tooltips: Dark tooltips match the Obsidian aesthetic instead of defaulting to system popups
  • Better typography: Segoe UI 10pt base, 11pt bold section headers, Consolas 9pt for the log
  • Wider default window: 1020×680 (up from 900×560), minimum 960×620 — options no longer clip or overlap
  • Profile and theme moved to a top bar: Full width, no longer fighting for space inside the Options panel
  • Clean light theme: White cards on light grey with blue accent, proper button states

What's Fixed

✓ Image Export Colorspace Crash

Reported: "Error: unsupported colorspace for 'png'" — conversion aborted when a PDF contained CMYK or ICC-profile images.

Cause: The colorspace check (pix.n > 4) missed plain CMYK images (n=4) because it only caught CMYK+alpha (n=5).

Fix: The check now uses pix.colorspace.n > 3, which correctly catches CMYK, ICC-based profiles, and any other non-RGB/grayscale colorspace. Alpha channels are also handled. Additionally, individual image failures now log a warning and skip rather than aborting the entire conversion.

✓ GUI Crash on Startup (AttributeError)

Reported: AttributeError: '_tkinter.tkapp' object has no attribute 'status_label' — the GUI crashed when a saved config file existed from a previous session.

Cause: _load_config() ran before _build_ui() in the initialisation sequence. If the saved config triggered a theme change, it tried to configure widgets that didn't exist yet.

Fix: _apply_theme() and _set_status() now guard against being called before the UI is fully built, deferring safely until _build_ui() completes.


Summary of All Changes

Area Change
models.py Added ocr_lang: str = "eng" to Options dataclass
extract.py lang= passed to pytesseract.image_to_data() and -l to ocrmypdf command
cli.py New --lang argument with documentation and examples
app_gui.py OCR language dropdown, multi-file batch conversion, safe output naming, full GUI redesign, init-order crash fix
pipeline.py Colorspace detection fix for image export, per-image error resilience
pyproject.toml Version bump, updated description, Python 3.13 classifier
init.py Version bump, updated docstring
README.md Full documentation of all new features, bug fixes, language setup guides

Ideal For

This update is recommended for:

  • Non-English document workflows — German, French, Japanese, Chinese, Arabic, and 100+ other Tesseract languages now accessible from both GUI and CLI
  • Batch conversion — Select dozens of PDFs in the GUI and convert them all with one click, no overwrite risk
  • Anyone using the GUI regularly — The redesigned interface is easier to scan, easier to read, and no longer clips controls at common window sizes
  • Users who hit the colorspace crash — CMYK and ICC-profile images in PDFs no longer abort the conversion
  • Users whose GUI crashed on startup — The init-order fix resolves the AttributeError seen when a saved config existed

Upgrade Notes

  • No breaking changes. All existing CLI commands, API calls, and saved configs continue to work.
  • New ocr_lang field defaults to "eng", matching previous behaviour.
  • Saved GUI config is forward-compatible; old configs load without issue.
  • Tesseract language packs must be installed separately for non-English OCR. See the README for platform-specific instructions.

Recommended for all users. Essential for non-English workflows and batch processing.