2.0.1 • Published 1 year ago

cloudmersive-ocr-api-client v2.0.1

Weekly downloads
24
License
Unlicense
Repository
-
Last release
1 year ago

cloudmersive-ocr-api-client

CloudmersiveOcrApiClient - JavaScript client for cloudmersive-ocr-api-client The powerful Optical Character Recognition (OCR) APIs let you convert scanned images of pages into recognized text. Cloudmersive OCR API provides advanced machine learning capabilities for converting scanned documents and photos of documents and receipts to text.

  • API version: v1
  • Package version: 2.0.1

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install cloudmersive-ocr-api-client --save
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

Finally, switch to the directory you want to use your cloudmersive-ocr-api-client from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

You should now be able to require('cloudmersive-ocr-api-client') in javascript files from the directory you ran the last command above from.

git

If the library is hosted at a git repository, e.g. https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file, that's to say your javascript file where you actually use this library):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var CloudmersiveOcrApiClient = require('cloudmersive-ocr-api-client');

var defaultClient = CloudmersiveOcrApiClient.ApiClient.instance;

// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Apikey.apiKeyPrefix['Apikey'] = "Token"

var api = new CloudmersiveOcrApiClient.ImageOcrApi()

var imageFile = "/path/to/file.txt"; // {File} Image file to perform OCR on.  Common file formats such as PNG, JPEG are supported.

var opts = { 
  'language': "language_example", // {String} Optional, language of the input document, default is English (ENG).  Possible values are ENG (English), ARA (Arabic), ZHO (Chinese - Simplified), ZHO-HANT (Chinese - Traditional), ASM (Assamese), AFR (Afrikaans), AMH (Amharic), AZE (Azerbaijani), AZE-CYRL (Azerbaijani - Cyrillic), BEL (Belarusian), BEN (Bengali), BOD (Tibetan), BOS (Bosnian), BUL (Bulgarian), CAT (Catalan; Valencian), CEB (Cebuano), CES (Czech), CHR (Cherokee), CYM (Welsh), DAN (Danish), DEU (German), DZO (Dzongkha), ELL (Greek), ENM (Archaic/Middle English), EPO (Esperanto), EST (Estonian), EUS (Basque), FAS (Persian), FIN (Finnish), FRA (French), FRK (Frankish), FRM (Middle-French), GLE (Irish), GLG (Galician), GRC (Ancient Greek), HAT (Hatian), HEB (Hebrew), HIN (Hindi), HRV (Croatian), HUN (Hungarian), IKU (Inuktitut), IND (Indonesian), ISL (Icelandic), ITA (Italian), ITA-OLD (Old - Italian), JAV (Javanese), JPN (Japanese), KAN (Kannada), KAT (Georgian), KAT-OLD (Old-Georgian), KAZ (Kazakh), KHM (Central Khmer), KIR (Kirghiz), KOR (Korean), KUR (Kurdish), LAO (Lao), LAT (Latin), LAV (Latvian), LIT (Lithuanian), MAL (Malayalam), MAR (Marathi), MKD (Macedonian), MLT (Maltese), MSA (Malay), MYA (Burmese), NEP (Nepali), NLD (Dutch), NOR (Norwegian), ORI (Oriya), PAN (Panjabi), POL (Polish), POR (Portuguese), PUS (Pushto), RON (Romanian), RUS (Russian), SAN (Sanskrit), SIN (Sinhala), SLK (Slovak), SLV (Slovenian), SPA (Spanish), SPA-OLD (Old Spanish), SQI (Albanian), SRP (Serbian), SRP-LAT (Latin Serbian), SWA (Swahili), SWE (Swedish), SYR (Syriac), TAM (Tamil), TEL (Telugu), TGK (Tajik), TGL (Tagalog), THA (Thai), TIR (Tigrinya), TUR (Turkish), UIG (Uighur), UKR (Ukrainian), URD (Urdu), UZB (Uzbek), UZB-CYR (Cyrillic Uzbek), VIE (Vietnamese), YID (Yiddish)
  'preprocessing': "preprocessing_example" // {String} Optional, preprocessing mode, default is 'Auto'.  Possible values are None (no preprocessing of the image), and Auto (automatic image enhancement of the image before OCR is applied; this is recommended).
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
api.imageOcrImageLinesWithLocation(imageFile, opts, callback);

Documentation for API Endpoints

All URIs are relative to https://api.cloudmersive.com

ClassMethodHTTP requestDescription
CloudmersiveOcrApiClient.ImageOcrApiimageOcrImageLinesWithLocationPOST /ocr/image/to/lines-with-locationConvert a scanned image into words with location
CloudmersiveOcrApiClient.ImageOcrApiimageOcrImageWordsWithLocationPOST /ocr/image/to/words-with-locationConvert a scanned image into words with location
CloudmersiveOcrApiClient.ImageOcrApiimageOcrPhotoRecognizeBusinessCardPOST /ocr/photo/recognize/business-cardRecognize a photo of a business card, extract key business information
CloudmersiveOcrApiClient.ImageOcrApiimageOcrPhotoRecognizeFormPOST /ocr/photo/recognize/formRecognize a photo of a form, extract key fields and business information
CloudmersiveOcrApiClient.ImageOcrApiimageOcrPhotoRecognizeFormAdvancedPOST /ocr/photo/recognize/form/advancedRecognize a photo of a form, extract key fields using stored templates
CloudmersiveOcrApiClient.ImageOcrApiimageOcrPhotoRecognizeReceiptPOST /ocr/photo/recognize/receiptRecognize a photo of a receipt, extract key business information
CloudmersiveOcrApiClient.ImageOcrApiimageOcrPhotoToTextPOST /ocr/photo/toTextConvert a photo of a document into text
CloudmersiveOcrApiClient.ImageOcrApiimageOcrPhotoWordsWithLocationPOST /ocr/photo/to/words-with-locationConvert a photo of a document or receipt into words with location
CloudmersiveOcrApiClient.ImageOcrApiimageOcrPostPOST /ocr/image/toTextConvert a scanned image into text
CloudmersiveOcrApiClient.PdfOcrApipdfOcrGetAsyncJobStatusGET /ocr/pdf/get-job-statusReturns the result of the Async Job - possible states can be STARTED or COMPLETED
CloudmersiveOcrApiClient.PdfOcrApipdfOcrPdfToLinesWithLocationPOST /ocr/pdf/to/lines-with-locationConvert a PDF into text lines with location
CloudmersiveOcrApiClient.PdfOcrApipdfOcrPdfToWordsWithLocationPOST /ocr/pdf/to/words-with-locationConvert a PDF into words with location
CloudmersiveOcrApiClient.PdfOcrApipdfOcrPostPOST /ocr/pdf/toTextConverts an uploaded PDF file into text via Optical Character Recognition.
CloudmersiveOcrApiClient.PreprocessingApipreprocessingBinarizePOST /ocr/preprocessing/image/binarizeConvert an image of text into a binarized (light and dark) view
CloudmersiveOcrApiClient.PreprocessingApipreprocessingBinarizeAdvancedPOST /ocr/preprocessing/image/binarize/advancedConvert an image of text into a binary (light and dark) view with ML
CloudmersiveOcrApiClient.PreprocessingApipreprocessingGetPageAnglePOST /ocr/preprocessing/image/get-page-angleGet the angle of the page / document / receipt
CloudmersiveOcrApiClient.PreprocessingApipreprocessingUnrotatePOST /ocr/preprocessing/image/unrotateDetect and unrotate a document image
CloudmersiveOcrApiClient.PreprocessingApipreprocessingUnrotateAdvancedPOST /ocr/preprocessing/image/unrotate/advancedDetect and unrotate a document image (advanced)
CloudmersiveOcrApiClient.PreprocessingApipreprocessingUnskewPOST /ocr/preprocessing/image/unskewDetect and unskew a photo of a document
CloudmersiveOcrApiClient.ReceiptsApireceiptsPhotoToCSVPOST /ocr/receipts/photo/to/csvConvert a photo of a receipt into a CSV file containing structured information from the receipt

Documentation for Models

Documentation for Authorization

Apikey

  • Type: API key
  • API key parameter name: Apikey
  • Location: HTTP header
2.0.1

1 year ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.9

4 years ago

1.2.8

4 years ago

1.2.7

5 years ago

1.2.6

5 years ago

1.2.5

5 years ago

1.2.4

5 years ago

1.2.3

5 years ago

1.2.2

5 years ago

1.2.1

5 years ago

1.2.0

5 years ago

1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago