PDF Underlay (Background) API
Send your PDF and a letterhead PDF, and get the letterhead placed behind the content of the pages you pick. Made for invoices, letters and branded reports.
- Free plan
- No credit card
Request
curl -X POST https://apdf.io/api/pdf/page/underlay \
-H "Authorization: Bearer TOKEN" \
-d file="FILE_URL" \
-d underlay="UNDERLAY_FILE_URL" \
-d from="3" \
-d to="2-z" \
-d repeat="1"
const data = new FormData();
data.append('file', 'FILE_URL');
data.append('underlay', 'UNDERLAY_FILE_URL');
data.append('from', '3');
data.append('to', '2-z');
data.append('repeat', '1');
fetch('https://apdf.io/api/pdf/page/underlay', {
headers: {'Authorization': 'Bearer TOKEN'},
method: 'POST',
body: data
})
.then(response => response.json())
.then(json => console.log(json));
use GuzzleHttp\Client;
$client = new Client();
$response = $client->post(
'https://apdf.io/api/pdf/page/underlay', [
'headers' => [
'Authorization' => 'Bearer TOKEN'
],
'form_params' => [
'file' => 'FILE_URL',
'underlay' => 'UNDERLAY_FILE_URL',
'from' => '3',
'to' => '2-z',
'repeat' => '1'
]
]);
$body = $response->getBody();
echo json_encode($body->getContents());
require 'rest-client'
response = RestClient.post(
'https://apdf.io/api/pdf/page/underlay',
{
'file' => 'FILE_URL',
'underlay' => 'UNDERLAY_FILE_URL',
'from' => '3',
'to' => '2-z',
'repeat' => '1'
},
{
Authorization: "Bearer TOKEN"
}
)
puts response.body
import requests
response = requests.post(
'https://apdf.io/api/pdf/page/underlay',
headers = {
'Authorization': 'Bearer TOKEN'
},
data = {
'file': 'FILE_URL',
'underlay': 'UNDERLAY_FILE_URL',
'from': '3',
'to': '2-z',
'repeat': '1'
}
)
print(response.text)
import (
"fmt"
"github.com/go-resty/resty/v2"
)
func main() {
client := resty.New()
data := map[string]string{
"file": "FILE_URL",
"underlay": "UNDERLAY_FILE_URL",
"from": "3",
"to": "2-z",
"repeat": "1"
}
resp, _ := client.R().
SetFormData(data).
SetHeader("Authorization", "Bearer TOKEN").
Post("https://apdf.io/api/pdf/page/underlay")
fmt.Println(resp.String())
}
import okhttp3.*;
class Pdf {
public static void main(String[] args) throws Exception {
OkHttpClient client = new OkHttpClient();
FormBody formBody = new FormBody.Builder()
.add("file", "FILE_URL")
.add("underlay", "UNDERLAY_FILE_URL")
.add("from", "3")
.add("to", "2-z")
.add("repeat", "1")
.build();
Request request = new Request.Builder()
.url("https://apdf.io/api/pdf/page/underlay")
.addHeader("Authorization", "Bearer TOKEN")
.post(formBody)
.build();
Response response = client.newCall(request).execute();
System.out.println(response.body().string());
}
}
Behind the text.
Never over it.
Your letterhead is drawn first, then your page on top of it.
The first page and the pages after it can each get their own.
- repeat=1
- A one-page background behind every page
- from=1 repeat=2
- Letterhead first, follow-up sheet after
- to=1
- Letterhead on the first page only
- to=2-z repeat=1
- Every page except the cover
- (none set)
- Page 1 behind page 1, 2 behind 2, and so on
Design added last.
Keep your templates plain and add the branding in one step. Change the letterhead once and every new document follows.
Invoices on letterhead
Generate plain invoices in your app and place the company letterhead behind them, instead of building it into every template.
Letters and notices
Send contracts, offer letters and notices on the official letterhead, with a lighter follow-up sheet from page two on.
One layout, many brands
Keep one document layout and swap the letterhead per brand, subsidiary or white-label customer when you generate it.
Forms and certificates
Lay the design of a form, voucher or certificate behind the values your app writes, so the result looks like the printed one.
Brand from anywhere.
Add the letterhead right where your documents get made.
One account and one monthly allowance behind every route.
One authenticated POST from any language. Copy-paste samples in cURL, Node.js, Python and more.
POST /api/pdf/page/underlay
Pick the action in any Zap and map files from earlier steps. No code and no servers to run.
Underlay PDF
Add the Apdf node to any workflow, on n8n Cloud or self-hosted, and chain it with your automation.
Underlay PDF pages
Let Claude, ChatGPT, Gemini or your own agent run it through the MCP server, on any paid plan.
underlay-pdf-pages
1,000 branded PDFs
a month. Free.
Start on the free plan and move up only when your volume does — up to 1,000,000 operations a month on Business.
- One call is one operation, however many pages.
- Only calls that do the work are counted.
- Hard limits, so no surprise overage charges.
Letterheads, answered
Underlay and letterhead tutorials
Your code made the PDF.
Then it went dark.
Opened, read, re-read, dropped on page 4 — you never see any of it. Share the PDFs you generate through Apdf recipient links, and every signal becomes something you can act on: ping Slack, update the CRM, let an agent follow up. Same account, same API token, one more call.
API · Webhook · MCP