Skip to content

Repository files navigation

TextExtractor for Windows

A modern OCR text extraction tool for Windows 11, built with WinUI 3 and the Windows App SDK. Capture text from any region of your screen, copy it to clipboard, and optionally have it read aloud with high-quality neural voices — all with a single keyboard shortcut.

Features

Screen Capture & OCR

  • Region Selection — Click and drag to select any area of your screen
  • Windows OCR Engine — Fast, accurate text recognition powered by Windows.Media.Ocr
  • Multi-Language Support — Supports all OCR languages installed on your system
  • Three Capture Modes — Preserve line breaks, flatten to a single line, or capture and speak

Text-to-Speech

  • Kokoro Neural Voices — 10 premium-quality voices (American and British, male and female) powered by the Sherpa-ONNX engine
  • One-Time Download — ~330MB voice model downloaded once, then runs entirely offline
  • Windows SAPI Voices — Built-in Windows voices also available as a fallback
  • Adjustable Speech Rate — Configurable from 0.5x to 3.0x speed
  • Test & Preview — Try any voice from the settings page before using it

Clipboard & History

  • Instant Clipboard Copy — Captured text is automatically copied to your clipboard
  • Additive Clipboard Mode — Optionally append text to existing clipboard content instead of replacing it
  • Capture History — Access previously captured text (configurable 10–500 items)
  • Word & Character Count — Each capture shows statistics in the notification

System Integration

  • Global Hotkeys — Work from any application, even when TextExtractor is minimized
  • System Tray — Runs quietly in the background with a right-click context menu
  • Start with Windows — Optional auto-start when you log in
  • Start Minimized — Launch directly to the system tray
  • Sound & Notification Feedback — Audio and visual confirmation on capture

Requirements

  • OS: Windows 10 version 1809 (build 17763) or later. Windows 11 recommended.
  • .NET 8.0 Runtime: Included in self-contained builds (no separate install needed)
  • Windows 10 SDK (10.0.26100.0): Only required when building from source

Installation

From a Release Build

  1. Download and extract the release archive
  2. Create desktop and Start Menu shortcuts using one of the following:
    • Double-click CreateShortcut.vbs
    • Or run in PowerShell:
      powershell -ExecutionPolicy Bypass -File CreateShortcut.ps1
  3. Launch TextExtractor from the desktop shortcut
  4. The app minimizes to the system tray — look for its icon in the taskbar

Auto-Start with Windows

Open Settings > General in the app and toggle Start with Windows. This creates a shortcut in your Windows Startup folder automatically.

Building from Source

Prerequisites

  • .NET 8 SDK
  • Windows 10 SDK (10.0.26100.0)
  • Visual Studio 2022 (recommended) or VS Code with the C# extension

Build Steps

  1. Clone the repository:

    git clone <repo-url>
    cd TextExtractorWin
  2. Build using the provided script:

    build.bat

    This will:

    • Automatically close any running instance of TextExtractor
    • Restore NuGet packages
    • Build Release configuration (x64)
    • Publish a self-contained application
    • Copy the output to the dist/ folder
  3. Or build manually:

    dotnet build TextExtractorWin.csproj -c Release -p:Platform=x64
    dotnet publish TextExtractorWin.csproj -c Release -r win-x64 --self-contained true -p:PublishSingleFile=false -p:Platform=x64
  4. Create desktop and Start Menu shortcuts:

    CreateShortcut.vbs
    

Usage

Keyboard Shortcuts

Shortcut Action
Ctrl+Shift+1 Capture text with line breaks preserved
Ctrl+Shift+2 Capture text as a single line (line breaks removed)
Ctrl+Shift+3 Capture text and read it aloud

How to Capture Text

  1. Press one of the hotkeys above (works from any application)
  2. Your screen dims — click and drag to draw a rectangle around the text
  3. Release the mouse button to capture
  4. The extracted text is automatically copied to your clipboard
  5. A notification confirms the capture with word and character count

System Tray

TextExtractor lives in your system tray when minimized. Right-click the tray icon for quick access:

  • Capture Text (with breaks) — Same as Ctrl+Shift+1
  • Capture Text (no breaks) — Same as Ctrl+Shift+2
  • Capture & Speak — Same as Ctrl+Shift+3
  • Settings — Open the settings window
  • Exit — Quit the application

Double-click the tray icon to open Settings.

Settings

Access settings by double-clicking the tray icon or via the tray context menu:

Page Options
General Start minimized, start with Windows, play sound on capture, show notifications, additive clipboard mode, max history items (10–500)
Shortcuts View current keyboard shortcut bindings
Languages Select the OCR language from installed Windows language packs
Speech Choose a voice (Windows or Kokoro), adjust speech rate (0.5x–3.0x), test voices, download Kokoro voice model
History Browse and re-copy previously captured text, clear history
About App version, feature overview, and credits

Kokoro Voice Setup

The first time you select a Kokoro voice in Speech settings, you'll be prompted to download the voice model (~330MB). This is a one-time download — after that, all Kokoro voices work entirely offline.

Available Kokoro Voices:

Voice Gender Accent
Bella Female American
Nicole Female American
Sarah Female American
Sky Female American
Adam Male American
Michael Male American
Emma Female British
Isabella Female British
George Male British
Lewis Male British

Technology Stack

Component Technology
UI Framework WinUI 3 with Windows App SDK 1.6
OCR Engine Windows.Media.Ocr (built-in Windows OCR)
Neural TTS Sherpa-ONNX with Kokoro voice models
Windows TTS System.Speech.Synthesis (SAPI5)
System Tray Windows Forms NotifyIcon on dedicated STA thread
Global Hotkeys Win32 RegisterHotKey via P/Invoke
MVVM Toolkit CommunityToolkit.Mvvm
Runtime .NET 8.0, self-contained deployment

Project Structure

TextExtractorWin/
├── Assets/                  App icon and resources
│   ├── app.ico
│   └── CreateIcon.ps1
│
├── Helpers/                 Win32 interop and screen capture
│   ├── NativeMethods.cs         P/Invoke declarations (hotkeys, window messages)
│   └── ScreenCapture.cs         GDI+ screen capture and bitmap conversion
│
├── Models/                  Data models
│   ├── CaptureMode.cs           Enum: WithLineBreaks, WithoutLineBreaks, CaptureAndSpeak
│   └── CaptureResult.cs         Capture data with text, word/char count, timestamp
│
├── Services/                Core application services
│   ├── ClipboardService.cs      Clipboard operations and capture history
│   ├── HotkeyService.cs         Global hotkey registration and dispatch
│   ├── KokoroService.cs         Kokoro neural TTS model management and synthesis
│   ├── NotificationService.cs   Windows app notifications
│   ├── OcrService.cs            Windows OCR engine wrapper
│   ├── SettingsService.cs       JSON settings persistence
│   ├── SoundService.cs          System sound playback
│   ├── SpeechService.cs         TTS routing (Windows SAPI + Kokoro)
│   └── TrayIconService.cs       System tray icon and context menu
│
├── Views/                   UI pages and windows
│   ├── MainWindow.xaml/.cs          Main window, hotkey handler, capture orchestration
│   ├── GeneralSettingsPage.xaml/.cs  General settings (startup, clipboard, notifications)
│   ├── ShortcutsSettingsPage.xaml/.cs  Keyboard shortcut display
│   ├── LanguagesSettingsPage.xaml/.cs  OCR language selection
│   ├── SpeechSettingsPage.xaml/.cs    Voice selection, speech rate, Kokoro download
│   ├── HistoryPage.xaml/.cs           Capture history browser
│   ├── AboutPage.xaml/.cs             App info and credits
│   └── SelectionOverlay.cs           WinForms region selection overlay
│
├── App.xaml/.cs             Application lifecycle and static service initialization
├── Program.cs               Custom entry point with DispatcherQueue bootstrap
├── app.manifest             DPI awareness, Windows compatibility
├── TextExtractorWin.csproj  Project configuration and dependencies
├── build.bat                Build, publish, and deploy script
├── CreateShortcut.vbs       Desktop and Start Menu shortcut creator
└── CreateShortcut.ps1       PowerShell shortcut creator (alternative)

License

MIT License

Credits

About

A modern OCR text extraction tool for Windows 11, built with WinUI 3 and the Windows App SDK. Capture text from any region of your screen, copy it to clipboard, and optionally have it read aloud with high-quality neural voices — all with a single keyboard shortcut.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages