Skip to content

Fields in PDFs your systems make

When a PDF comes from another system (a quote, an order form, a contract made from a template), you don’t want someone placing the fields by hand every time. Threadkite can find where the fields go in the PDF itself. When a PDF is uploaded, Threadkite looks for them in this order:

  1. Anchor text: short codes like [[signature:customer]] printed in the document.
  2. Form fields: the fillable boxes a PDF form already has (made in Acrobat, Word or most form tools).
  3. A layout: fields placed once on a sample, for a template you can’t change.
  4. By hand, in the editor in Settings > Documents.

Anchor text and form fields can be used together in the same PDF. Whichever way the fields were placed, the preview before sending is the same, and nothing is sent while a field is missing, off the page or has no one to fill it.

Kind What it is Who fills it
signature Where someone signs The signer
initials Where someone initials The signer
date_signed The date they signed Threadkite, as they sign
name Their name Threadkite, as they sign
text Something they type in (a purchase order number) The signer
date A date they choose The signer
checkbox A tick box The signer
merge A value from the contact, filled in before sending Threadkite, from the contact

A merge field is filled in when the request is made and can’t be changed by the person signing. It takes a merge field’s key: contact.name, contact.firstName, contact.address, one of your contact fields (contact.fields.budget), request.date (the date it was sent) or request.reference (the request’s reference, such as SR-4F7K2). The editor lists every key you can use.

Kind Required?
signature, initials, date_signed, name Always. Every role signs.
text, date, checkbox Optional unless marked required
merge Required unless marked optional

The signer can’t finish while a required field is empty. A required merge field the contact has no value for has to be typed in before the request can be sent; an optional one is left blank. In the editor, select a text, date or tick box field and turn on Must be filled in.

Each field belongs to a role, such as customer or staff. You give each role a person when you send: a contact, who signs by a link, or someone in your team, who signs in the app.

When the roles come from the PDF, the customer signs first, staff countersign last, and any other roles sign in between, one after the other, in the order the PDF names them. A role named with spaces (Guarantor 2) is given the key guarantor_2. You can change the order in the editor, including letting two roles sign at the same time.

Put the code where the field goes, in the document’s template. Print it in white so it doesn’t show: Threadkite covers it with a white box anyway, and places the field over it.

[[kind:role]]
[[kind:role:What it asks]]
[[kind:role:What it asks|required]]
[[kind:role:What it asks|optional]]
[[merge:merge.key]]
[[merge:merge.key|optional]]

For example:

Anchor text Becomes
[[signature:customer]] The customer’s signature
[[initials:customer]] The customer’s initials
[[date_signed:customer]] The date the customer signed
[[signature:staff]] A countersignature from your team
[[text:customer:Purchase order number|required]] A text box the customer must fill in
[[date:customer:Preferred delivery date]] An optional date
[[checkbox:customer:I have read the terms|required]] A tick box the customer must tick
[[merge:contact.address]] The contact’s address, filled in before sending

Lower-case kinds only, and one code per field. The field starts where the code starts and is at least as wide as the code: a signature is at least 160 by 36 points and initials 60 by 30, and anything else 120 by 16; a tick box is a square. A field taller than the line of text grows upwards from it, so leave room above a signature. Fields follow the text however long the document gets, so a quote with three lines or thirty works the same.

A code Threadkite can’t read (an unknown kind, a merge field without a key, a field without a role) is reported when the PDF is uploaded, and the document can’t be sent until someone places that field.

If the PDF is a form with fillable boxes, its empty boxes become fields where they are, the size they are:

In the PDF Becomes
An empty signature box A signature
An empty text box A text field, or a date field when the box is formatted as a date
An unticked tick box A tick box
A box already filled in or ticked Part of the document, printed as it is
A locked (read-only) box Part of the document, printed as it is
Lists, radio buttons, buttons, passwords Part of the document, printed as it is

A text box or tick box keeps the form’s required setting, its tooltip (or else its name) as what it asks, and its character limit. Signatures are always required.

Name a form field like anchor text, without the brackets, to say exactly what it is and who fills it. The name wins over what kind of box it is, so any box can be any kind of field:

Form field name Becomes
signature:customer The customer’s signature
signature:staff A countersignature from your team
date_signed:customer The date the customer signed
text:customer:Order number|required A text box the customer must fill in
merge:contact.address The contact’s address, filled in before sending

The brackets are allowed too ([[signature:customer]]). A form field with a name like this is always used, even if it is filled in or locked.

A form field with an ordinary name (Signature1, Order number) doesn’t say who fills it:

  • If nothing in the PDF names a role and the form has at most one signature box, the form is for one person, and every field goes to the Customer role.
  • Otherwise (a form with a buyer’s and a seller’s signature, say), Threadkite doesn’t guess: someone chooses who fills each field in the editor before it can be sent. Name the fields (signature:customer, signature:staff) to skip this.

A PDF that has already been signed digitally can’t be signed again: changing it would break the signature that is already there, so it is refused when uploaded. Upload the document from before it was signed. An empty signature box is not a signature, so a form with one is fine.

Threadkite draws everything itself, so in the copy that is signed the form’s boxes are no longer fillable: what the signer sees is what is signed.

If your system’s template can’t be changed, upload a sample PDF as a layout and place the fields on it once in the editor. A field’s page can be counted from the end (“last page”), so a signature at the foot of the last page lands in the right place on every quote, however long. Send the PDF with the layout’s id as layoutId (see below). Anchor text or form fields in the PDF win over the layout.

You’ll need an API key with the documents:write and signing_requests:write scopes (see Scopes).

  1. Upload the PDF as a one-off document: POST /v1/documents?library=false, as multipart/form-data with the PDF in a field named file (up to 20 MB and 50 pages). The answer is the document with the fields Threadkite found, and problems: anything that stops it being sent as it is. To upload a library document or a layout instead, leave out library=false (and add kind=layout for a layout).

  2. Send it: POST /v1/signing-requests with the thread it is sent from, the document, and a signer for each role:

    {
    "threadId": "0b7c…",
    "documents": [{ "documentId": "9e21…" }],
    "signers": [
    { "role": "customer", "contactId": "5f3a…", "channel": "email" },
    { "role": "staff", "userId": "user_8d2…" }
    ],
    "record": { "type": "quote", "externalId": "Q-1042" },
    "send": true
    }

    Add "layoutId" next to documentId to place a layout’s fields. mergeValues gives values for merge fields the contact has no value for. record says which record in your system it is about, so its events say so. "send": false leaves a draft on the thread for your team to check and send instead; a draft isn’t counted until it is sent. POST /v1/signing-requests/preview takes the thread, the document and the merge values and answers with the merge values, whether they fit their boxes, and any problems, without sending anything.

  3. Hear what happens with webhooks: signing_request.sent, .viewed, .signed (one signer), .completed (everyone), .declined, .cancelled and .expired.

  4. Fetch the signed PDF: GET /v1/signing-requests/{id}/file answers with a link to it that works for 5 minutes. Once everyone has signed it is the sealed copy, with a certificate page saying who signed, when and how (before then, the PDF as sent).

An app can do the same without the API calls: its action on a thread can return a document with a link to the PDF, and Threadkite fetches it and leaves a draft on the thread.