Signature fields for an e-signature provider
A template's signature lines become empty PDF signature fields. When your
system sends the PDF to an e-signature provider, it has to tell the
provider where each person signs. Oomplo gives you that in the
X-Oomplo-Signature-Fields header of POST /api/templates/{id}/render:
a percent-encoded JSON array, one entry per field.
[
{
"name": "Podpis-6D2B0A11-0000-4000-8000-000000000002",
"label": "Client",
"page": 1,
"rect": [328.6, 452.0, 508.6, 542.0],
"pageSize": [595.3, 841.9],
"role": "Client",
"signer": "John Smith",
"email": "[email protected]"
}
]
| Key | Meaning |
|---|---|
name | The PDF field's name; a provider that signs existing fields uses it directly |
page | The page, from 1 |
rect | The field's box in points (1/72 inch), [left, bottom, right, top] from the page's bottom-left corner, as PDF's /Rect |
pageSize | The page's width and height in points |
role, signer, email | Who signs, from the signature line and the data |
Mapping to a provider #
Providers place signatures in one of two ways:
- By field name. Tell the provider to sign the existing field
namefor the person withemail. Nothing else is needed. By position. Many providers take a page and a box from the top-left corner, sometimes in pixels or as a fraction of the page. Convert from Oomplo's bottom-left points:
x = rect[0] y = pageSize[1] - rect[3] (top edge from the top) width = rect[2] - rect[0] height = rect[3] - rect[1] fraction of the page: divide x and width by pageSize[0], y and height by pageSize[1]
Decode the header first (decodeURIComponent in JavaScript,
urllib.parse.unquote in Python), then parse the JSON. The demo
service-agreement.docx has two signature lines, Provider and Client,
with the signers' names and e-mails taken from the data.
Company seal #
With "seal": true Oomplo itself seals the PDF with the company seal
(server settings OOMPLO_SEAL_KEY, OOMPLO_SEAL_CERT): an invisible
signature over the whole file that shows the document left Oomplo
unchanged. Seal before sending to the provider only if the provider keeps
earlier signatures (incremental signing); otherwise let the provider seal.