- ✨ Features
- 🚀 Quick Start
- 🎬 Demo
- 📋 Requirements
- 🔧 Installation
- 🔑 API Key Setup
- 📝 Usage Guide
- 🛠️ Building from Source
- ❓ Troubleshooting
- 🤝 Contributing
- 📄 License
- 🙏 Acknowledgments
- 📷 Image Processing - Extract text from various image formats:
- JPG/JPEG
- PNG
- GIF
- BMP
- WEBP
- TIFF
- 📑 PDF Support - Extract text from PDF documents
- 👁️ Preview - View your images and PDFs directly in the app
- 📋 Copy to Clipboard - One-click copying of extracted text
- 💾 Save Results - Export extracted text to a file
- 🌙 Dark Mode - Easy on the eyes UI for day and night use
- 🧠 AI-Powered - Utilizes Google's advanced Gemini 2.5 Flash model for accurate text recognition
- Download the latest release
- Get a Google Gemini API key (instructions below)
- Run the application and enter your API key
- Drag & drop an image or PDF file
- View and use the extracted text!
See the OCR App in action:
Before you begin, ensure you have the following:
- 💻 Windows operating system (Windows 10 or later recommended)
- 🔄 .NET 9.0 Runtime or SDK (Download here)
- 🔑 Google Gemini API key (free to obtain)
- 🌐 Internet connection (for API communication)
- Download the latest installer from the releases page
- Run the installer and follow the on-screen instructions
- Launch the application from your Start menu or desktop shortcut
- Download the latest ZIP file (
OCRApp_Release.zipor similar) from the GitHub Releases page. - Extract the ZIP file to a location of your choice.
- Run
OCRApp.exefound inside the extracted folder to start the application.
The OCR App requires a Google Gemini API key to function. Here's how to get one:
- Visit the Google AI Studio website
- Sign in with your Google account (create one if needed)
- Click on "Create API Key"
- Copy your new API key for use with the OCR App
There are two ways to configure your API key:
Option 1: Using the apikey.txt file (Recommended)
- Run the application once to generate the template apikey.txt file
- Open the apikey.txt file located in the application directory
- Replace "YOUR_GEMINI_API_KEY_HERE" with your actual Gemini API key
- Save the file
YOUR_ACTUAL_API_KEY_GOES_HERE
Option 2: Using an environment variable
Set the GEMINI_API_KEY environment variable to your Gemini API key:
Windows Command Prompt:
set GEMINI_API_KEY=your_api_key_here
Windows PowerShell:
$env:GEMINI_API_KEY="your_api_key_here"
Permanent Environment Variable:
- Press
Win + R, typesysdm.cpl, and press Enter - Go to the "Advanced" tab
- Click "Environment Variables"
- Under "User variables", click "New"
- Variable name:
GEMINI_API_KEY - Variable value: your API key
- Click OK on all dialogs
- Launch the application:
- If you downloaded the release: Double-click
OCRApp.exefrom the folder where you extracted the release ZIP file. - If you built from source: Navigate to the build output directory (e.g.,
OCRApp\bin\Release\net9.0-windows\) and double-clickOCRApp.exe, or rundotnet runfrom theOCRAppdirectory after building.
- If you downloaded the release: Double-click
- Load a file using one of these methods:
- Drag and drop an image or PDF file onto the application window
- Click the "Browse" button to select a file
- Use the File menu and select "Open"
- View the preview of your document in the left panel
- Wait for processing - The application will communicate with the Gemini API to extract text
- Review the results displayed in the right panel
- Use the extracted text with the buttons at the bottom:
- Copy to clipboard
- Save to a text file
| Action | Shortcut |
|---|---|
| Open File | Ctrl+O |
| Save Text | Ctrl+S |
| Copy Text | Ctrl+C |
| Exit | Alt+F4 |
If you want to build the application from source:
-
Ensure you have the following prerequisites:
- Visual Studio 2022 or later
- .NET 9.0 SDK
- Git (optional, for cloning the repository)
-
Clone or download the repository:
git clone https://github.com/yourusername/OCRApp.git -
Open the solution file (
OCR.sln) in Visual Studio -
Restore NuGet packages:
- Right-click on the solution in Solution Explorer
- Select "Restore NuGet Packages"
-
Build the solution:
- Select "Build" > "Build Solution" from the menu
- Or press Ctrl+Shift+B
-
Run the application:
- Press F5 to start debugging.
- Or Ctrl+F5 to start without debugging.
- The executable will be located in the build output directory, typically
bin\Debug\net9.0-windows\orbin\Release\net9.0-windows\.
Application won't start
- Ensure you have .NET 9.0 Runtime installed
- Check Windows Event Viewer for error details
- Try running as administrator
API Key errors
- Verify your API key is correct
- Ensure the apikey.txt file is in the correct location
- Check your internet connection
- Verify the API key has not expired or been revoked
File processing issues
- Ensure the file format is supported
- Check that the file is not corrupted
- For large files, allow more time for processing
- For PDFs, ensure they are not password-protected
Text extraction quality issues
- Ensure the image is clear and text is legible
- For better results, use higher resolution images
- Some handwritten text or complex layouts may not extract perfectly
Contributions are welcome! If you'd like to contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the License file for details.
- Google Gemini API for powerful text extraction capabilities
- .NET Community for the framework and tools
- Vibe Coded with assistance from the Cline VSCode Plugin and Google's Gemini 2.5 Pro model.
Made with ❤️ for the OCR community

