# Templates and markers

Mark where each signer signs, initials, dates or fills in a field by writing [[esign:…]] markers in your PDF.

You don't place signature boxes by hand. Write a **marker** in the document where a field goes, for example
`[[esign:sign]]`, and eSign puts the field there when you send it. Markers work in any PDF that has real text in it
(not a scanned image): PDF templates in EspoCRM, or PDFs from Word or any other tool. Word files themselves are not
accepted: save them as PDF first.

## Where the field goes

The field starts at the marker's left edge and sits on its baseline: put the marker right where the line for the
signature begins.

In EspoCRM PDF templates, write markers as tiny white text so they don't show:

```html
<span style="color:#ffffff;font-size:2px;">[[esign:sign]]</span>
```

Markers in normal-size text (4 pt or more) are painted over when the document is sent, so they never show either.

## The markers

| Marker | Field | Who fills it in | Default size (points) |
|---|---|---|---|
| `[[esign:sign]]` or `[[esign:signature]]` | Signature | The signer (required) | 170 × 30 |
| `[[esign:initials]]` | Initials | The signer (required) | 60 × 26 |
| `[[esign:date]]` | Date signed | Filled in when they sign | 110 × 16 |
| `[[esign:name]]` | Signer's name | Filled in automatically | 150 × 16 |
| `[[esign:email]]` | Signer's email | Filled in automatically | 180 × 16 |
| `[[esign:text]]`, `[[esign:text:Phone]]` | Text, with an optional label | The signer (required) | 140 × 16 |
| `[[esign:title]]` | Text labelled "Title" | The signer (required) | 140 × 16 |
| `[[esign:company]]` | Text labelled "Company" | The signer (required) | 140 × 16 |
| `[[esign:check:I_agree]]` or `[[esign:checkbox:I_agree]]` | Checkbox, with a label | The signer (optional) | 14 × 14 |

Every signer needs at least one `[[esign:sign]]`.

## Writing a marker

```text
[[esign:type:Label@N|w=WIDTH|h=HEIGHT]]
```

- **No spaces** anywhere in a marker. In labels, write `_` for a space: `[[esign:check:I_agree]]` shows "I agree".
- `:Label` (optional) names a text field or checkbox.
- `@N` (optional) is for the Nth signer, counting signers in the order they are given; without it, the field is for the
  first signer. Example: `[[esign:sign@2]]`.
- `|w=` and `|h=` (optional) change the size in points. Width can be 10 to 600 and height 8 to 200; fields are always at
  least 40 points wide and stay clear of the page's right edge.
- Keep that order: label, then `@N`, then sizes. Upper or lower case both work.

### Examples

| Marker | Means |
|---|---|
| `[[esign:sign]]` | Signer 1 signs here. |
| `[[esign:sign@2\|w=120\|h=24]]` | Signer 2 signs here, in a 120 × 24 box. |
| `[[esign:initials@2]]` | Signer 2 initials here. |
| `[[esign:text:Phone\|h=20]]` | Signer 1 types a phone number. |
| `[[esign:title\|w=100]]` | Signer 1 types their job title. |
| `[[esign:check:I_agree]]` | An optional "I agree" checkbox. |

## Dates

The signing date is written as month/day/year in English and day/month/year in Spanish, following the document's
language.

## When a document can't be sent

eSign checks the markers before sending and explains what's wrong:

- *This document has no signature markers ([[esign:sign]]), so it cannot be sent for signature.* If it is a proposal or
  another document that isn't signed, use Print to PDF instead.
- *The PDF has a marker for signer 2, but only 1 signer(s) were given.*
- *Signer "…" has no [[esign:sign]] marker in the PDF.*

> [!TIP]
> In EspoCRM, templates can also include `{{esign.sender.name}}`, `{{esign.signer.name}}` and today's date, see
> [The EspoCRM app](https://docs.sapiensandmachines.com/en/esign/espocrm-app#values-for-templates).

## How the signed PDF looks

Each signature is placed in its box at the left, with "Signed electronically by NAME" (or "Initialed by NAME") in
small text above it. The last page is a **certificate of completion** with the document's fingerprint and each
signer's history (see [What signers see](https://docs.sapiensandmachines.com/en/esign/signer-experience#the-signed-copy)).
