OCR in Javascript
How to use OCR with TTA in Javascript.
Use OCR in Javascript
import { TextToAnything } from "@texttoanything/nodets";
const TTA = new TextToAnything(/*API token here*/);
const ocrText = await TTA.OCR(file, "eng", "image/jpeg", "text");
Use TTA's OCR functionality in Javascript to extract text from images. You can specify the language and MIME type of the image.
There are 2 modes available:
- Text - will return plain text
- HOCR - will return a (HTML like structure)