ocr_flutter_web
A Flutter web-only plugin to extract text from Images and PDF files using Tesseract.js and PDF.js.
✨ Features
- PDF & Image Support: Process
.jpg,.jpeg,.png, and.pdffiles. - English & Hindi: Standard support for
engandhin. - Auto-Rotation: Detects and corrects rotated text automatically.
- Colored Text Preprocessing: Built-in canvas filters to enhance contrast for colored text and symbols like
₹. - Zero-Config: Dynamically loads dependencies via CDNs. No
index.htmledits needed.
🚀 Getting Started
Installation
Add the following to your pubspec.yaml:
dependencies:
ocr_flutter_web: ^1.0.0
Basic Usage
import 'package:ocr_flutter_web/ocr_flutter_web.dart';
final _ocrPlugin = OcrFlutterWeb();
String result = await _ocrPlugin.extractText(
fileBytes,
filename: "file.pdf",
language: 'eng+hin',
);
⚙️ Requirements
- Flutter SDK:
^3.19.0 - Dart SDK:
^3.3.0
📄 License
MIT License. See LICENSE for details.