Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Page Properties
hiddentrue

Status

Status
colourPurpleYellow
titlestartedfor review

Approver

Pavel Shkadzko

The layout of the document describes the textual content of a document with positional information, based on the processed document.

Request
Headers

Header

Value

Accept

application/vnd.gini.v1+json

Code Block
languagejson
//retrie a layout of the document


    GET /documents/{id}/layout
Example

curl -H 'Authorization: BEARER <token>'
    -X GET -H 'Accept: application/vnd.gini.v1+json

...

'
    -i https://pay-api.gini.net/documents/c292af40-d06a-11e2-9a2f-000000000000/layout
Response
Headers

Status Code

Description

200 (OK)

Operation is successful.

Header

Value

Content-Type

application/vnd.gini.v1+json

Body (application/vnd.gini.v1+json)

Key

Type

Description

pages

array

Array of page objects.

Page object

Key

Type

Description

number

number

Number of the page starting with 1.

sizeX

number

Width of the page.

sizeY

number

Height of the page.

textZones

array

Array of textzone objects.

regions

array

Array of region objects.

TextZone object

Key

Type

Description

paragraphs

array

Array of paragraph objects.

Paragraph object

Key

Type

Description

w

number

Width of the paragraph.

h

number

Height of the paragraph.

t

number

Distance of the paragraph from the upper edge of the page.

l

number

Distance of the paragraph from the left edge of the page.

lines

array

Array of line objects.

Line object

Key

Type

Description

w

number

Width of the line.

h

number

Height of the line.

t

number

Distance of the line from the upper edge of the page.

l

number

Distance of the line from the left edge of the page.

wds

array

Array of word objects.

Word object

Key

Type

Description

h

number

Height of the word.

w

number

Width of the word.

l

number

Distance of the word from the left edge of the page.

t

number

Distance of the word from the upper edge of the page.

fontSize

number

Font size of the word in points.

fontFamily

string

Name of the font family of the word.

bold

boolean

Indicates bold font style.

text

string

Text of word.

Region object

Key

Type

Description

h

number

Height of the region of interest.

w

number

Width of the region of interest.

l

number

Distance of the region from the left edge of the page.

t

number

Distance of the region from the upper edge of the page.

type

string

Type of the region of interest

, e.g.

, for example, RemittanceSlip.

Errors

Status Code

Description

404 (Not Found)

The requested layout is invalid.

Code Block
languagejson
//layout example

{
  "pages": [
    {
      "number": 1,
      "sizeX": 595.3,
      "sizeY": 841.9,
      "textZones": [
        {
          "paragraphs": [
            {
              "l": 54.0,
              "t": 158.76,
              "w": 190.1,
              "h": 36.55000000000001,
              "lines": [
                {
                  "l": 54.0,
                  "t": 158.76,
                  "w": 190.1,
                  "h": 10.810000000000002,
                  "wds": [
                    {
                      "l": 54.0,
                      "t": 158.76,
                      "w": 18.129999999999995,
                      "h": 9.900000000000006,
                      "fontSize": 9.9,
                      "fontFamily": "Arial-BoldMT",
                      "bold":false,
                      "text": "Ihre"
                    },
                    {
                      "l": 74.86,
                      "t": 158.76,
                      "w": 83.91000000000001,
                      "h": 9.900000000000006,
                      "fontSize": 9.9,
                      "fontFamily": "Arial-BoldMT",
                      "bold":false,
                      "text": "Vorgangsnummer"
                    },
                    {
                      "l": 158.76,
                      "t": 158.76,
                      "w": 3.3000000000000114,
                      "h": 9.900000000000006,
                      "fontSize": 9.9,
                      "fontFamily": "Arial-BoldMT",
                      "bold":false,
                      "text": ":"
                    },
                    [...]
                  ]
                },
                [...]
              ]
            }
          ]
        }
      ],
      "regions": [
        {
          "l": 20.0,
          "t": 240.1,
          "w": 190.0,
          "h": 150.3,
          "type": "RemittanceSlip"
        },
        [...]
      ]
    },
    [...]
  ]
}