Date field
Add a date / time or datetime field to your template and control the output format with the format
and locale
attributes.
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 templaterequiredoptional
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 date
.font_sizeoptional
Specify the font size to be filled with. Defaults to 9coloroptional
Specify the font color to be used. Format is either common color cod names (e.g. black, red, etc.) or hex color codes. Defaults to `black`.h_alignoptional
Horizontal alignment of the to be filled text. Possible values are `L` for left aligned, `C` for centering and `R` for right aligned text. Defaults to `L`.v_alignoptional
Vertical alignment of the to be filled text. Possible values are `T` for top aligned, `C` for centering and `B` for bottom aligned text. Defaults to `B`.font
Defined the font to be used: Currently supported are: `courier`, `helvetica` and `times_roman`. Defaults to `helvetica`.localerequired
The locale which should be used for formatting the
datetime.formatrequired
Format for the resulting datetime. Examples for date '2022-05-21 21:16:00+02:00':
%Y-%m-%d
will output2022-05-21
%d-%m-%Y %H:%M:%S
will output21-05-2022 21:16:00
%A
outputs the full week day in the specified locale, e.g with localeen_US
:Saturday
%x
outputs locale’s appropriate date representation, e.g. with localeen_US
:05/21/2022
%X
outputs locale’s appropriate time representation, e.g. with localeen_US
:21:16:00
%B
outputs locale’s appropriate month name, e.g. with localeen_US
:May
cells
Boolean field indicating whether to activate cells. Defaults to `false`cell_count
Optional field to specify the number of cells within the field. Each cell is filled with a single character. Cells are equally spaced across the width of the field. Must be 1 or greater if cells are enabled.cell_offset
Integer field to specify the offset from which char in the value the fields should start to be filled. E.g. if the provided value is `345235` and the field is configured with offset 3 and has 3 cells, the resulting value will be `235`. Defaults to 0.{
"bbox": {
"x": 72.15405575993107,
"y": 556.1774688664345,
"width": 201.3371400656083,
"height": 11.637984974890685
},
"name": "key",
"page": 0,
"required": false,
"type": "text",
"font_size": 9,
"color": "black",
"h_align": "L",
"v_align": "B",
"font": "helvetica",
"locale": "en_US",
"format": "%Y-%m-%d %H:%M:%S",
}