Add Images 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

Adds images to selected pages of a PDF and makes the modified PDF available for download.


Image Placement: Each item in image_files corresponds by position to an item in input_options. Provide at least one placement-options item for every uploaded image.

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/addimages \
  --header 'Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52' \
  --header 'content-type: multipart/form-data' \
  -F 'file=@file_path' \
  -F 'image_files=approved-stamp.png' \
  -F 'input_options=[
  [
    {
      "page_ranges": "1,3-5",
      "image_rect": {
        "top": "48px",
        "left": "72px",
        "width": "160px",
        "height": "80px"
      },
      "odd_or_even_pages": "odd"
    }
  ]
]' \
  -F 'output_settings={
  "name": "Quarterly Review Approved.pdf"
}'

Request Body

multipart/form-data
filebinary(Required)

The source PDF to modify, 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.

Example
quarterly-review.pdf
image_filesarray[binary](Required)

The images to place in the PDF, uploaded directly or imported from publicly accessible URLs. Provide between 1 and 10 files, each no larger than 10 MB and with a filename not exceeding 255 characters. Supported formats: jpg, jpeg, png.

Example
[
  "approved-stamp.png"
]
Range :[1 .. 10][1 .. 10]
input_optionsarray[array](Required)

The image-placement groups. Provide between 1 and 10 groups.

Example
[
  [
    {
      "page_ranges": "1,3-5",
      "image_rect": {
        "top": "48px",
        "left": "72px",
        "width": "160px",
        "height": "80px"
      },
      "odd_or_even_pages": "odd"
    }
  ]
]
Range :[1 .. 10][1 .. 10]
output_settingsJSON Object(Required)

Configures the name of the modified PDF.

Example
{
  "name": "Quarterly Review Approved.pdf"
}
Show Sub-Attributes
namestring(Required)

The name to assign to the modified PDF. The .pdf extension is appended when it is omitted.

Example
Quarterly Review Approved.pdf
Maximum Length :255255Copied!

Body Parameters

Copied!
// Note: payload contains multiple type attributes

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

// type: array[file]
image_files = [
  "approved-stamp.png"
]

// type: array
input_options = [
  [
    {
      "page_ranges": "1,3-5",
      "image_rect": {
        "top": "48px",
        "left": "72px",
        "width": "160px",
        "height": "80px"
      },
      "odd_or_even_pages": "odd"
    }
  ]
]

// type: object
output_settings = {
  "name": "Quarterly Review Approved.pdf"
}
▼ Show full

Response Example

200
Copied!
  {
    "status": "inprogress",
    "status_check_url": "https://www.zohoapis.com/pdfeditor/api/v1/pdf/addimages/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.