Insert Watermark and Store
Purpose
This API allows you to insert a watermark to a PDF document.
HTTP Request URL
https://{zohoapis_domain}/pdfeditor/api/v1/pdf/watermark/store
Body Parameters
Parameter | Data Type | Description |
Mandatory Parameters | ||
file
| File or String
| Upload the PDF file in which the watermark needs to be inserted using one of the following methods:
Note: The maximum file size allowed for the input PDF is 50 MB. It cannot be more than 150 pages. |
image_file | File or String | This param is applicable only if you want to insert an image watermark. Upload the image file using one of the following methods:
Note: The maximum file size allowed for the input image is 10 MB. |
input_options | { [OR] { | type(mandatory) - Specifies the watermark type. Only text watermark is supported as of now.
image_info - Contains image watermark settings:
|
output_settings | { "name": "<new document name>", "folder_id": "<folder_id>" , "overwrite_existing_file": "<true/false>" }
| Pass the values for 'name' and 'folder_id' via this parameter as JSON. name -> Specify the name for the modified PDF document. folder_id -> Specify the ID of the folder in which you would like to store the modified PDF document. overwrite_existing_file (optional) -> Use this param if you wish to replace an existing file stored in Zoho WorkDrive with the modified PDF document. |
Note:
- This API will only be available for users who have a Zoho WorkDrive account.
- To use this API, an OAuth token should be generated with the following scopes: ZohoWriter.pdfEditor.ALL,WorkDrive.organization.ALL,WorkDrive.files.ALL
input_options
Parameter | Data Type | Possible Values | Default Value |
content | string | Maximum up to 500 characters | |
rotation | string | diagonal / horizontal | |
font_color | string | rgb(191,191,191) | Black |
font_family | string | Only Web-safe fonts | Roboto |
font_size | integer | Maximum up to 108 | 72 |
opacity | float | Maximum upto 1 | 0.4 |
height | integer | It should be within or equal to the document’s height and width. | 200 |
width | integer | It should be within or equal to the document’s height and width. | 200 |
Sample Request
Copiedcurl --location --request POST "https://www.zohoapis.com/pdfeditor/api/v1/pdf/watermark/store" \
--header "Authorization: Zoho-oauthtoken xxx.yyy.zzz" \
--form 'file=@"/Users/username/Documents/Sample.pdf"' \
--form 'input_options="{\"type\":\"image\",\"image_info\":{\"opacity\":\"0.5\",\"height\":\"200\",\"width\":\"200\"}}"' \
--form 'output_settings=“{\”name\”:\”ModifiedFile.pdf\"}"'
Once the process begins, you will initially receive the 'status_url'. By invoking the 'status_url', you will be able to monitor the status of the scheduled job.
Sample Response
Copied{
"status_check_url" : "https://pdf.zoho.com/pdfeditor/api/v1/pdf/watermark/store/job/f931a01183b33",
"document_url" : "https://workdrive.zoho.com/file/ponazfea04477109f4681a831e7177d96bc40",
"document_id" : "ponazfea04477109f4681a831e7177d96bc40",
"status" : "inprogress"
}
Success Response
Copied{
"document_url" : "https://workdrive.zoho.com/file/ponazfea04477109f4681a831e7177d96bc40",
"document_id" : "ponazfea04477109f4681a831e7177d96bc40",
"status": "success"
}