OCR Reader

Document Template – YAML Configuration Guide

Overview

Document templates are used to extract specific fields from documents such as invoices, forms, or reports.

Each field is defined individually with its own position and data type.

This template is ideal when data is fixed in position (not tabular).

Fields Definition

fields:
  - name: invoice_number
    type: text
  - name: date
    type: date
  - name: total
    type: currency

Field Areas

Each field requires coordinates defining its position on the document.

areas:
  invoice_number:
    x: 100
    y: 150
    width: 300
    height: 50

  total:
    x: 500
    y: 700
    width: 200
    height: 60

Full Example

template:
  type: document
  name: invoice_header

source:
  type: pdf

fields:
  - name: invoice_number
    type: text
  - name: date
    type: date
  - name: total
    type: currency

areas:
  invoice_number:
    x: 100
    y: 150
    width: 300
    height: 50

  date:
    x: 400
    y: 150
    width: 200
    height: 50

  total:
    x: 500
    y: 700
    width: 200
    height: 60

Best Practices

Back to Documentation