ocr-text-selector
TypeScript icon, indicating that this package has built-in type declarations

0.0.8 • Public • Published

📦 OCR Text Selector (Angular / Ionic Library)

npm version npm downloads license

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.


✨ Features

  • 🔍 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.

⚙️ Setup

1. Install the package

npm install ocr-text-selector

📖 Usage

1. Import the Module

import { OcrTextSelectorModule } from 'ocr-text-selector';

@NgModule({
  imports: [
    BrowserModule,
    OcrTextSelectorModule
  ],
  bootstrap: [AppComponent]
})
export class AppModule {}

2. Add the Component

<ocr-text-selector
  [imageSrc]="'assets/sample.jpg'"
  (textSelected)="onTextSelected($event)">
</ocr-text-selector>

3. Handle the Event

onTextSelected(text: string) {
  console.log('User selected:', text);
  alert('Selected: ' + text);
}

Readme

Keywords

none

Package Sidebar

Install

npm i ocr-text-selector

Weekly Downloads

163

Version

0.0.8

License

none

Unpacked Size

17.5 kB

Total Files

5

Last publish

Collaborators

  • jaisoncp.cs89