Add Header and Footer to PDF
Adds a header, a footer, or both to a page range of a PDF, replacing any existing headers and footers, and makes the modified PDF available for download.
Font Precedence: A zone's font_name and font_size override font_settings for that zone.
Endpoint
OAuth Scope
Request Example
curl --request POST \
--url https://www.zohoapis.com/pdfeditor/api/v1/pdf/content/headerfooter \
--header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
--header 'content-type: multipart/form-data' \
-F 'file=@file_path' \
-F 'input_options={
"header_options": [
{
"position": "center",
"text": "<<Page 1 of n>>",
"font_name": "roboto_bold",
"font_size": 10
}
],
"footer_options": [
{
"position": "left",
"text": "<<yyyy-mm-dd>>",
"font_name": "roboto",
"font_size": 9
}
],
"font_settings": {
"font_name": "roboto",
"font_size": 10
},
"margins": {
"margin_top": 15,
"margin_bottom": 10,
"margin_left": 10,
"margin_right": 15
},
"page_range": {
"start_page": 1
}
}' \
-F 'password=OpenSesame123'import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.io.IOException;
import java.net.http.HttpTimeoutException;
public class Main {
public static void main(String[] args) throws Exception{
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://www.zohoapis.com/pdfeditor/api/v1/pdf/content/headerfooter"))
.header("content-type", "multipart/form-data")
.header("Authorization", "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52")
.method("POST", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = {
'content-type': "multipart/form-data",
'Authorization': "Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52"
}
conn.request("POST", "/pdfeditor/api/v1/pdf/content/headerfooter", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
headersMap = Map();
headersMap.put("Accept", "application/json");
list_of_text=List();
file=invokeurl
[
url : "public fileURL link"
type : GET
];
list_of_text.add({"paramName":"file","content":file,"stringPart":"false"});
list_of_text.add({"paramName":"input_options","content":"[object Object]","stringPart":"true"});
list_of_text.add({"paramName":"password","content":"OpenSesame123","stringPart":"true"});
response = invokeUrl
[
url: "https://www.zohoapis.com/pdfeditor/api/v1/pdf/content/headerfooter"
type: POST
headers: headersMap
files: list_of_text
connection: connection_name
]
info response;
Request Body
multipart/form-dataThe source PDF to add headers/footers to, uploaded directly or imported from a publicly accessible URL. The file must be no larger than 50 MB, contain no more than 400 pages, and have no page larger than 2,400 square inches. Its filename must not exceed 255 characters. Supported formats: pdf.
Configures the header and footer text, styling, and page range. At least one setting must be provided.
{
"header_options": [
{
"position": "center",
"text": "<<Page 1 of n>>",
"font_name": "roboto_bold",
"font_size": 10
}
],
"footer_options": [
{
"position": "left",
"text": "<<yyyy-mm-dd>>",
"font_name": "roboto",
"font_size": 9
}
],
"font_settings": {
"font_name": "roboto",
"font_size": 10
},
"margins": {
"margin_top": 15,
"margin_bottom": 10,
"margin_left": 10,
"margin_right": 15
},
"page_range": {
"start_page": 1
}
}Show Sub-Attributes
Up to 3 header entries, one per zone (left, center, right).
[
{
"position": "center",
"text": "<<Page 1 of n>>",
"font_name": "roboto_bold",
"font_size": 10
}
]Show Sub-Attributes
Which zone of the header this entry occupies. If more than one entry targets the same zone, the last one in the array wins.
The header text for this zone. Static text can be combined with page number or date macros in the same value.
Page number macros: <<1>>, <<1 of n>>, <<1/n>>, <<Page 1>>, <<Page 1 of n>>.
Date macros, which insert the current date: slash-separated (e.g. <<m/d>>, <<mm/dd/yyyy>>, <<d/m/yy>>, <<dd/mm/yyyy>>, <<mm/yyyy>>), dot-separated (e.g. <<m.d.yy>>, <<mm.dd.yyyy>>, <<d.m.yyyy>>, <<dd.mm.yy>>, <<mm.yyyy>>), and dash-separated (<<yy-mm-dd>>, <<yyyy-mm-dd>>).
The text cannot contain #.
The font for this zone.
The font size for this zone.
Up to 3 footer entries, one per zone (left, center, right).
[
{
"position": "left",
"text": "<<yyyy-mm-dd>>",
"font_name": "roboto",
"font_size": 9
}
]Show Sub-Attributes
Which zone of the footer this entry occupies. If more than one entry targets the same zone, the last one in the array wins.
The footer text for this zone. Static text can be combined with page number or date macros in the same value.
Page number macros: <<1>>, <<1 of n>>, <<1/n>>, <<Page 1>>, <<Page 1 of n>>.
Date macros, which insert the current date: slash-separated (e.g. <<m/d>>, <<mm/dd/yyyy>>, <<d/m/yy>>, <<dd/mm/yyyy>>, <<mm/yyyy>>), dot-separated (e.g. <<m.d.yy>>, <<mm.dd.yyyy>>, <<d.m.yyyy>>, <<dd.mm.yy>>, <<mm.yyyy>>), and dash-separated (<<yy-mm-dd>>, <<yyyy-mm-dd>>).
The text cannot contain #.
The font for this zone.
The font size for this zone.
Document-wide font defaults for all header and footer zones.
{
"font_name": "roboto",
"font_size": 10
}Show Sub-Attributes
The default font for all header and footer zones.
The default font size for all header and footer zones.
Document-wide margins, in millimeters, applied to the header and footer.
{
"margin_top": 15,
"margin_bottom": 10,
"margin_left": 10,
"margin_right": 15
}Show Sub-Attributes
The top margin, in millimeters, reserved for the header.
The bottom margin, in millimeters, reserved for the footer.
The left margin, in millimeters, for header/footer text.
The right margin, in millimeters, for header/footer text.
Configures the starting page for the header/footer.
{
"start_page": 1
}Show Sub-Attributes
The first page the header and footer are applied to. They apply from this page through the last page.
The password to unlock the source PDF, if it is password-protected.
Body Parameters
// Note: payload contains multiple type attributes
// type: file
file = quarterly-review.pdf
// type: object
input_options = {
"header_options": [
{
"position": "center",
"text": "<<Page 1 of n>>",
"font_name": "roboto_bold",
"font_size": 10
}
],
"footer_options": [
{
"position": "left",
"text": "<<yyyy-mm-dd>>",
"font_name": "roboto",
"font_size": 9
}
],
"font_settings": {
"font_name": "roboto",
"font_size": 10
},
"margins": {
"margin_top": 15,
"margin_bottom": 10,
"margin_left": 10,
"margin_right": 15
},
"page_range": {
"start_page": 1
}
}
// type: string
password = OpenSesame123Response Example
{
"status": "inprogress",
"status_check_url": "https://www.zohoapis.com/pdfeditor/api/v1/pdf/content/headerfooter/job/3f65c7592a741d98e46bf310cbe678f574a1d51fce306a8d9b6430217e538acd"
}
Rate Limits
Duration - Time window for the threshold.
Threshold - Number of API calls allowed within the specified duration.
Lock Period - Wait time before consecutive API requests.
© 2026, Zoho Corporation Pvt. Ltd. All Rights Reserved.