Our /document/autorotate Robot

Auto-rotate documents to the correct orientation

🤖/document/autorotate corrects the orientation of documents.

With this Robot, you can correct orientation issues in documents and text-heavy images.

Often times scanned documents are not oriented correctly because of a mistake during the manual scanning process. Or because the phone was not held correctly when taking a picture of the document. These orientation issues make reading the document more cumbersome.

This Robot analyzes the text in the document or image and corrects the orientation to ensure each page is oriented upright.

The supported formats are: PDF, JPEG, PNG, GIF, TIFF, WebP, BMP, JPEG 2000. To use this Robot with other formats, use /document/convert first to convert the document into a PDF or a supported image format.

Note: Documents and images must contain sufficient text to infer the correct orientation. Images without text will not be rotated.

Usage example

Auto-rotate individual pages of uploaded documents to the correct orientation:

{
  "steps": {
    "rotated": {
      "robot": "/document/autorotate",
      "use": ":original"
    }
  }
}

Parameters

  • use

    String / Array of Strings / Object required

    Specifies which Step(s) to use as input.

    • You can pick any names for Steps except ":original" (reserved for user uploads handled by Transloadit)

    • You can provide several Steps as input with arrays:

      "use": [
        ":original",
        "encoded",
        "resized"
      ]
      

    💡 That’s likely all you need to know about use, but you can view Advanced use cases.

Related blog posts