OCR Preprocessing API: Get the Angle of the Page, Document or Receipt for an OCR Conversion

It’s very common to take photos for OCR operations now, but those photos are often imperfect. You can easily work around this issue with our Page Angle OCR Preprocessing API, which will quickly analyze and identify the rotation angle of the page in question. With that information, you can adjust the page as needed to ensure the subsequent OCR operation works perfectly as intended.

To help you take advantage of this API with JavaScript, we’ve included ready-to-run code with instructions to structure your API call below.

Let’s kick things off by installing the jQuery library. You can do that by running the below command:

bower install jquery

Once that’s done, include the below snippet to capture the input file for the preprocessing operation:

var form = new FormData();
form.append("imageFile", fileInput.files[0], "file");

Last but not least, let’s structure the API call:

var settings = {
"url": "https://api.cloudmersive.com/ocr/preprocessing/image/get-page-angle",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "multipart/form-data",
"processData": false,
"mimeType": "multipart/form-data",
"contentType": false,
"data": form
$.ajax(settings).done(function (response) {

Once you include your Cloudmersive API key, you’re all set — easy as pie. To get a key, simply register a free account on our website (Home — Cloudmersive APIs). With that account, you’ll receive a limit of 800 API calls per month.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.