Adding Electronic Signatures to Your App with HTML Sign Fields
How to add e-signatures to any document using simple HTML elements. No separate signing service needed — generate and sign in one API call.
The old way: coordinates and overlays
Traditional e-signature APIs (DocuSign, HelloSign) require you to upload a finished PDF and then specify signature field positions using pixel coordinates:
// DocuSign-style field placement
{
"signers": [{
"tabs": {
"signHere": [{
"xPosition": "200",
"yPosition": "400",
"pageNumber": "1"
}]
}
}]
}
This means you need to know the exact pixel position of every signature field. If your document layout changes — different content length, different font size, different page breaks — your coordinates break.
The new way: HTML sign fields
With pdfRelay, signature fields are HTML elements that flow with your content:
<h1>Service Agreement</h1>
<p>Terms and conditions here...</p>
<sign-field type="checkbox" signer="client"
label="I agree to the terms" required>check</sign-field>
<sign-field type="signature" signer="client" required>Sign here</sign-field>
<sign-field type="date" signer="client">Date</sign-field>
No coordinates. No pixel math. The fields render as styled placeholders in the PDF and become interactive when the signer opens their signing link. If your document gets longer and pushes the signature to the next page, it just works — no coordinate recalculation needed.
This is the same HTML you already know. No proprietary API. No separate signing service. Generate and sign in one API call.
The API
const response = await fetch('https://pdfrelay.com/api/v1/sign', {
method: 'POST',
headers: {
'Authorization': 'Bearer sk_live_...',
'Content-Type': 'application/json',
},
body: JSON.stringify({
source: 'html',
content: htmlWithSignFields,
signers: [
{ role: 'client', name: 'Jane Smith', email: 'jane@example.com' },
{ role: 'provider', name: 'Bob Wilson', email: 'bob@company.com' },
],
}),
});
const { signers } = await response.json();
// signers[0].sign_url → send this to Jane
// signers[1].sign_url → send this to Bob
When all signers complete, the document is sealed with their signatures overlaid and an audit trail appended. Included with all paid plans — no per-signature fees.