Turn image to text in Node.js
Image to Text in Node.js
More showcases >let source = Module.WasmAsposeOCRInput();
source.url = internalFileName;
let batch = new Module.WasmAsposeOCRInputs();
batch.push_back(source);
// Send image for OCR
var result = Module.AsposeOCRRecognize(batch);
// Output extracted text to the console
var text = Module.AsposeOCRSerializeResult(
result, Module.ExportFormat.text);
console.log(text);
Why Opt for Aspose.OCR for Node.js?
Aspose.OCR for Node.js allows you to extract text from scanned pages, photos, screenshots, and other images on any platform where Node.js is installed. Empower your on-premise products, web services, serverless applications, AWS Lambda, Azure Functions, and other code with optical character recognition functionality.
Our powerful and feature rich Optical Character Recognition (OCR) API supports 130+ languages based on Latin, Cyrillic and Asian scripts, including Chinese and Hindi, and can recognize files in the most popular formats.
Efficient and Accurate OCR
Achieve high-speed and accurate OCR results with advanced Node.js technology.
Multilingual Support
Recognize text in more than 130 languages, including Latin, Cyrillic, Arabic, Persian, Indic, and Chinese scripts, ensuring versatility for your Node.js applications.
Versatile Image Support
Process images from scanners, cameras, and smartphones effortlessly with Node.js.
Precision in Chinese Character Recognition
Recognize over 6,000 Chinese characters with precision in your Node.js projects.
Layout detection
Identify and categorize content blocks in images to ensure the correct order of extracted text, regardless of layout.
Live code sample
Initiate text recognition from images with several lines of code of code. Experience the simplicity!
* By uploading your files or using the service you agree with our Terms of use and Privacy Policy.
Convert image to text
More examples >fs.readFile("source.png", (err, imageData) => {
// Save photo to the virtual storage
const imageBytes = new Uint8Array(imageData);
let internalFileName = "temp";
let stream = Module.FS.open(internalFileName, "w+");
Module.FS.write(stream, imageBytes, 0, imageBytes.length, 0);
Module.FS.close(stream);
// Add photo to recognition batch
let source = Module.WasmAsposeOCRInput();
source.url = internalFileName;
let batch = new Module.WasmAsposeOCRInputs();
batch.push_back(source);
// Automatically adjust recognition settings to better process photographs
let recognitionSettings = Module.WasmAsposeOCRRecognitionSettings();
recognitionSettings.detect_areas_mode = Module.DetectAreasMode.PHOTO;
recognitionSettings.auto_contrast= true;
// Send photo for OCR
var result = Module.AsposeOCRRecognize(batch, recognitionSettings);
// Output extracted text to the console
var text = Module.AsposeOCRSerializeResult(result, Module.ExportFormat.text);
console.log(text);
});
Integration to Node.js Applications
Aspose.OCR for Node.js seamlessly integrates with any platform supporting C++ - whether on desktop Windows, Windows Server, macOS, Linux, or the cloud.
Supported file formats
Aspose.OCR for Node.js via C++ can work with virtually any file you can get from a scanner or camera. Recognition results are returned in the most popular file and data exchange formats that can be saved, imported to a database, or analyzed in real time.
Images
- JPEG
- PNG
- TIFF
- BMP
Batch OCR
- ZIP
Recognition results
- Text
- JSON
- XML
Experience performance and quality
Cutting-edge OCR technology ensures swift and accurate text recognition from images, empowering your applications with top-notch capabilities. Elevate your project’s efficiency and user experience with our high-performance OCR solution.
130+ Recognition Languages
Node.js OCR API recognizes lots of languages and popular writing scripts, including mixed languages:
Leave language detection to the library or define the language yourself for enhanced recognition performance and reliability.
- Extended Latin alphabet: English, Spanish, French, Indonesian, Portuguese, German, Vietnamese, Turkish, Italian, Polish, and 80+ more;
- Cyrillic alphabet: Russian, Ukrainian, Kazakh, Serbian, Belarusan, Bulgarian;
- Arabic, Persian, Urdu;
- Chinese and Devanagari script, including Hindi, Marathi, Bhojpuri, and others.
Suitable for any content
The accuracy and reliability of text recognition is highly dependent on the quality of the original image. Aspose.OCR for Node.js via C++ provides an extensive range of both fully automated and manual image processing filters that enhance an image before it is sent to the OCR engine.
Features and Capabilities
Aspose.OCR for Node.js via C++ Explore the advanced features of Aspose.OCR for Node.js.
Photo OCR
Extract text from smartphone photos with scan-level accuracy.
Searchable PDF
Convert any scan into a fully searchable and indexable document.
URL recognition
Recognize an image from URL without downloading it locally.
Bulk recognition
Read all images from multi-page documents, folders and archives.
Any font and style
Identify and recognize text in all popular typefaces and styles.
Fine-tune recognition
Adjust every OCR parameter for best recognition results.
Node.js OCR Code Samples
Discover code samples to easily integrate OCR into your Node.js applications.
Installing
Aspose.OCR for Node.js is delivered as an NPM package or as a self-contained downloadable file with no external dependencies. Easily install it into your project, and you’re ready to recognize texts in multiple supported languages and get recognition results in various formats.
Import OCR for Node.js module in your code.
const Module = require("aspose-ocr/lib/asposeocr");
Image to Text Recognition with Node.js
Node.js OCR allows to transform table images into editable text, streamlining data extraction. Ideal for various business cases, our powerful OCR solution enhances data accessibility, improving productivity in applications.
Setup Table image to text conversion - Node.js
// Load a scan or photo from user input
const fileData = new Uint8Array(e.target.result);
let filename = file.name;
let stream = Module.FS.open(filename, "w+");
Module.FS.write(stream, fileData, 0, fileData.length, 0);
Module.FS.close(stream);
var input = Module.WasmAsposeOCRInput();
input.url = filename;
// Analyze tabular structures
var settings = Module.WasmAsposeOCRRecognitionSettings();
settings.detect_areas_mode = Module.DetectAreasMode.TABLE;
// Limit the subset of characters to improve recognition accuracy and increase performance
settings.alphabet = "1234567890.,;";
// Extract text from a table
var inputs = new Module.WasmAsposeOCRInputs();
inputs.push_back(input);
var result = Module.AsposeOCRRecognize(inputs, settings);
var editableText = Module.AsposeOCRSerializeResult(result, Module.ExportFormat.text);