Skip to main content
Coordinates tie a field to a spot on the page. Anchors tie it to a phrase in the text instead, so the same integration keeps working when the contract grows a paragraph and the signature line moves down. This guide uploads an agreement with two anchors and sends it with a signature field on each of the positions Circularo calculated. It takes two calls.

Before you begin

  • The document is a PDF with a text layer. Anchors are found in the document’s text. A scan with no text layer has nothing to match.

How anchors work

You give each anchor an id of your choosing, the text to look for, and an offset that says where the field goes relative to that text. Circularo searches the document and returns the calculated position for every place the text was found. The search runs line by line. Use text for an exact phrase, letter case included, or regexp for a pattern, which ignores letter case for the unaccented letters A to Z only. The offset is measured from the top-left corner of the first character of the match, and — like every position in the API — its values are fractions of the page: An offset of 0 on both axes puts the field directly on top of the anchor text, which is rarely what you want — shift it above, below or beside the phrase.

Step 1: Upload the document with anchors

The agreement ends with two lines, Employee signature: and Employer signature:. Anchor a field above each of them:
Request
The same upload with curl:
Response
Every anchor you sent is answered, in the order you sent it, under the id you gave it — with one entry in matches per place the text was found. Here that is one each, both on page 1. The two positions share the same y and differ in x, exactly like the two signature lines on the page.
An anchor whose text is nowhere in the document is not an error: it comes back with an empty matches list. Check for that before you build the transaction — it means the document does not look the way you expected, and no field would be placed.

Step 2: Place a field on each calculated position

A matches entry’s position has exactly the shape a placed field expects, so it goes into signatureFields as it is:
Request
Response
Both fields land on the anchor-derived positions, and the transaction starts. From here the flow is the one you already know: recipients act, and the transaction advances.
A regexp anchor is the way to place fields on a repeating structure — signature: matches both lines of this agreement and returns both positions, each with its page. Prefer the most specific phrase you can: a short, common word matches far more often than you intend.

Complete example

Uploading with anchors and sending the agreement, as a Node.js script. Error handling is minimal for brevity — in production, inspect the error envelope of non-2xx responses.

Next steps