Add Watermark to PDF

Open in ChatGPT Open in ChatGPT to ask questions about this page
Open in Claude Open in Claude to ask questions about this page
Copy as MarkdownCopy this page as markdown to use with AI assistants
View as Markdown Open this page as markdown in a new tab

Stamps a watermark onto every page of a PDF and makes the watermarked file available for download.


Watermark Type: When input_options.type is text, provide input_options.text_info. When it is image, provide input_options.image_info and image_file.

Endpoint

OAuth Scope

ZohoWriter.pdfEditor.ALLCopied!

Request Example

cURL
cURL
Java
Python
Deluge
Copied!
curl --request POST \
  --url https://www.zohoapis.com/pdfeditor/api/v1/pdf/watermark \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: multipart/form-data' \
  -F 'file=@file_path' \
  -F 'input_options={
  "type": "text",
  "text_info": {
    "content": "CONFIDENTIAL",
    "rotation": "Diagonal",
    "font_color": "rgb(204,0,0)",
    "font_family": "Helvetica",
    "font_size": 36
  }
}' \
  -F 'output_settings={
  "name": "quarterly-report-watermarked"
}' \
  -F 'image_file=@file_path'

Request Body

multipart/form-data
filebinary(Required)

The source PDF to watermark, 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. Supported formats: pdf.

Example
quarterly-report.pdf
input_optionsJSON Object(Required)

Configures the watermark to apply.

Example
{
  "type": "text",
  "text_info": {
    "content": "CONFIDENTIAL",
    "rotation": "Diagonal",
    "font_color": "rgb(204,0,0)",
    "font_family": "Helvetica",
    "font_size": 36
  }
}
Show Sub-Attributes
typestring(Required)

The watermark variant to apply: text-based or image-based.

Example
text
Allowed Values :
Show Values ▾
textCopied!
imageCopied!
Copied!Copy all as JSON Array
Maximum Length :1010Copied!
text_infoJSON Object(Optional)

Text watermark settings.

Example
{
  "content": "CONFIDENTIAL",
  "rotation": "Diagonal",
  "font_color": "rgb(204,0,0)",
  "font_family": "Helvetica",
  "font_size": 36
}
Show Sub-Attributes
contentstring(Required)

The text to stamp on each page.

Example
CONFIDENTIAL
Maximum Length :500500Copied!
rotationstring(Required)

The orientation of the watermark text on the page.

Example
Diagonal
Allowed Values :
Show Values ▾
HorizontalCopied!
DiagonalCopied!
Copied!Copy all as JSON Array
font_colorstring(Optional)

The color of the watermark text. Accepts rgb(r,g,b), a six-digit hex #RRGGBB, a three-digit hex #RGB, or a CSS named color.

Example
rgb(204,0,0)
font_familystring(Optional)

The font face for the watermark text.

Example
Helvetica
Maximum Length :100100Copied!
font_sizeinteger(Optional)

The font size for the watermark text, in points.

Example
36
image_infoJSON Object(Optional)

Image watermark settings.

Example
{
  "opacity": 0.5,
  "height": 100,
  "width": 150
}
Show Sub-Attributes
opacityfloat(Optional)

Controls the transparency of the watermark image.

Example
0.5
heightinteger(Optional)

The rendered height of the watermark image.

Example
100
widthinteger(Optional)

The rendered width of the watermark image.

Example
150
output_settingsJSON Object(Required)

Configures the watermarked PDF's filename.

Example
{
  "name": "quarterly-report-watermarked"
}
Show Sub-Attributes
namestring(Required)

The name to assign to the watermarked PDF.

Example
quarterly-report-watermarked
Maximum Length :255255Copied!
image_filebinary(Optional)

The image to use as the watermark, uploaded directly or imported from a publicly accessible URL. The file must be no larger than 10 MB, and its pixel area must not exceed 144,000,000 pixels. Supported formats: jpg, png.

Example
company-logo.png

Body Parameters

Copied!
// Note: payload contains multiple type attributes

// type: file
file = quarterly-report.pdf

// type: object
input_options = {
  "type": "text",
  "text_info": {
    "content": "CONFIDENTIAL",
    "rotation": "Diagonal",
    "font_color": "rgb(204,0,0)",
    "font_family": "Helvetica",
    "font_size": 36
  }
}

// type: object
output_settings = {
  "name": "quarterly-report-watermarked"
}

// type: file
image_file = company-logo.png
▼ Show full

Response Example

200
Copied!
  {
    "status": "inprogress",
    "status_check_url": "https://www.zohoapis.com/pdfeditor/api/v1/pdf/watermark/job/qE8Vn4M2kP7sR9xW"
  }
                
▼ Show full

Rate Limits

Duration1 minute
Threshold50
Lock Period5 minutes 30 seconds
Duration1 hour
Threshold200
Lock Period15 minutes
Duration1 day
Threshold2000
Lock Period2 hours

Duration - Time window for the threshold.
Threshold - Number of API calls allowed within the specified duration.
Lock Period - Wait time before consecutive API requests.