ocr-text-selector
is an Angular/Ionic component library that provides a Google Lens–like OCR text selection experience.
Users can run OCR on an image, see bounding boxes, and tap/click to select text directly from the image.
- 🔍 OCR text recognition using Tesseract.js.
- 🖱️ Select text (word-level) from an image.
- 📤 Emits selected text to your app.
- 📱 Works in both Angular and Ionic.
- ⚡ Angular 17+ compatible.
npm install ocr-text-selector
import { OcrTextSelectorModule } from 'ocr-text-selector';
@NgModule({
imports: [
BrowserModule,
OcrTextSelectorModule
],
bootstrap: [AppComponent]
})
export class AppModule {}
<ocr-text-selector
[imageSrc]="'assets/sample.jpg'"
(textSelected)="onTextSelected($event)">
</ocr-text-selector>
onTextSelected(text: string) {
console.log('User selected:', text);
alert('Selected: ' + text);
}