Free plan

Layout Analysis

Find the headings, paragraphs and tables on a scanned page
POST
/v1/ai/ocr/layout

About this tool

This tool looks at a scanned page and finds its blocks, such as headings, paragraphs, tables and pictures, with their positions and the order in which to read them. It uses a text reader for the positions and an AI model only to name each block's role. You can straighten a tilted photo or clean up a noisy one first.
For example, you have a scanned report and you want to see how its page is laid out before you process it further.

How to use it

  1. Choose this tool.
  2. Add your scan or photo with Upload, or drag and drop it.
  3. If the photo is tilted or noisy, turn on the straighten or clean up switches.
  4. Press Generate.
  5. Read the list of blocks, or copy or download it.

What you get back

You get a list of the page blocks with their type, position and reading order. You can copy or download it.
TEST IT LIVE

Try Layout Analysis in the Studio

One click opens the Studio with this tool already selected. Add your file and see the result in seconds.
Open in the Studio
Family
AI
Plan
Free
Method
POST
Endpoint
/v1/ai/ocr/layout
Tool ID
ai.ocr.layout
Authentication
API key
Accepts
Text and settings
Background jobs
Yes
Usage group
Ai
For developers

Use it from your code

cURL

curl -X POST "https://app.h2i.davixlabs.io/v1/ai/ocr/layout" \
  -H "X-Api-Key: $DAVIX_H2I_API_KEY" \
  -F 'files=@document.pdf' \
  -F 'on_unsupported=error' \
  -F 'quality=standard' \
  -F 'strategy=auto'

Node.js

const { DavixH2I } = require('@davixlabs/h2i-sdk');

const h2i = new DavixH2I({ apiKey: process.env.DAVIX_H2I_API_KEY, baseUrl: process.env.DAVIX_H2I_URL });
const result = await h2i.ai.ocr.layout({
    "files": 'document.pdf',
    "on_unsupported": "error",
    "quality": "standard",
    "strategy": "auto"
  });
console.log(result.data, result.requestId);

PHP

<?php
require 'vendor/autoload.php';

$h2i = new \Davix\H2I\Client(['apiKey' => getenv('DAVIX_H2I_API_KEY'), 'baseUrl' => getenv('DAVIX_H2I_URL')]);
$result = $h2i->ai()->ocr()->layout([
    'files' => 'document.pdf',
    'on_unsupported' => 'error',
    'quality' => 'standard',
    'strategy' => 'auto',
]);
echo $result->requestId;
FAQ

Frequently asked questions

Real block coordinates from Tesseract; a model only assigns roles and reading order by block id. Readiness: unbenchmarked (see GET /v1/ai/capabilities/ocr.layout).

Classification: hybrid. Deterministic stages: Tesseract TSV block geometry, image normalisation (Sharp).

Layout Analysis works from text and settings, so no file is needed. Every input is optional.

Layout Analysis is included in every plan, including Free. Each run uses credits from your monthly allowance.

Send a POST request to /v1/ai/ocr/layout with your API key in the X-Api-Key header. Official SDKs for Node.js, Python, PHP, Go, Java, .NET and Ruby do the same for you, and the code box on this page shows ready-to-copy examples. For large work it can also run as a background job, so your request returns straight away.