Browse our Products

Latest release

What was changed

This is the first released version of Aspose.OCR for JavaScript via C++ library. As such, it contains no new features, improvements, or fixes from previous releases.

Stay tuned for further updates!

Public API changes and backwards compatibility

This section lists all public API changes introduced in Aspose.OCR for JavaScript via C++ 23.7.0 that may affect the code of existing applications.

Added public APIs:

First release.

Updated public APIs:

First release.

Removed public APIs:

First release.

Get started

The example below illustrates how to use the library on your web page.

Preparing the environment

  1. Make sure your system can run a web server. This example will show you how to host the contents of a folder using Python 3.
  2. Download Aspose.OCR for JavaScript via C++ package.
  3. Extract the archive to the folder on your computer.
  4. Go to the lib subfolder of the folder where you extracted the library.

Create a web page

Create index.html file:

<!doctype html>
		<title>Aspose.OCR for JavaScript via C++</title>
		<p><b>Provide image file:</b></p>
		<input type="file" id="sourceFile">
		<div id="outputConsole" style="border: solid 1px #cccccc; padding: 10px;"></div>
		var Module = {
			onRuntimeInitialized: function()
				// Interface
				const sourceFile = document.getElementById("sourceFile");
				sourceFile.addEventListener("change", handleImgUpload);
				const outputConsole = document.getElementById("outputConsole");
				log("Select an image to continue...");

				// Recognition
				function handleImgUpload(event)
					const file =[0];
					log(`Source image: ${}`);
					const reader = new FileReader();
					reader.onload = function(e){
						const fileData = new Uint8Array(;
						let filename =;
						let stream =, "w+");
						Module.FS.write(stream, fileData, 0, fileData.length, 0);
						var input = Module.WasmAsposeOCRInput();
						var inputs = new Module.WasmAsposeOCRInputs();
						var settings = Module.WasmAsposeOCRRecognitionSettings();
						input.url = filename;
						var result = Module.AsposeOCRRecognize(inputs, settings);
						var result_str = Module.AsposeOCRSerializeResult(result, Module.ExportFormat.text);
						log("Recognition result:");
					log("Recognition started, please wait...");

				// Logging
				function log(text)
					outputConsole.innerHTML += `<p>${text}</p>`;
		<script src="asposeocr.js"></script>

Running the example

  1. Run the web server using Python:
    python -m http.server 8080
  2. Open http://localhost:8080/ with a web browser.
  3. Select an image and wait for recognition to complete.