Image field

An image field rendering the provided image within the bounding box defined. The aspect ratio of the image is preserved.

Attributes

bbox.xrequired
X coordinate of the lower left corner of the bounding box of the field. Needs to be greater than or equal to 0.
bbox.yrequired
Y coordinate of the lower left corner of the bounding box of the field. Needs to be greater than or equal to 0.
bbox.widthrequired
Width of the bounding box of the field. Needs to be greater or equal to 1.
bbox.heightrequired
Height of the bounding box of the field. Needs to be greater or equal to 1.

The units of the bounding box are points. They are mainly driven by the page size and resolution of the underlying PDF document. For example an A4 page with width of 210 mm and height of 297 mm and a default resolution of 72 DPI results in a page width of 595.27 and height of 841.88 pts. The root coordinate (0, 0) is the lower left corner of the page.


namerequired
Key name of the field. This is going to be the key for populating the value when filling the template. This key name can be used multiple times, every occurrence of the key will be filled with the same value. Caution: do not mix field types.
pagerequired
The index of the page the field is residing on, starting with 0. Upper limit is the number of pages in the template
requiredoptional
Is the key required in the payload when filling the PDF. Default is true.
typerequired
Identifier of the type of the field. Always set to image.
anchorrequired
Anchor of how to place the image in the bounding box. The image is always scaled preserving the aspect ratio of the input to be contained within the bounding box. Possible values are nw, n, ne, w, c, e, sw, s, se. Defaults to c.
{
    "bbox": {
        "x": 72.15405575993107,
        "y": 556.1774688664345,
        "width": 201.3371400656083,
        "height": 11.637984974890685
    },
    "name": "key",
    "page": 0,
    "required": true,
    "type": "image",
    "anchor": "c"
}

Providing the image

Example: your image field has the name image, then you need to provide the value for the image as a base64 string. To achieve this, include in your request:

{
    "image": {
        "type": "base64",
        "value": "<<your base64 value>>"
    }
}

or the simplified version for base64 data:

{
    "image": "<<your base64 value>>"
}