Duplicate Pages and Store
Purpose
This API allows you to duplicate specific pages within a PDF.
HTTP Request URL
https://{zohoapis_domain}/pdfeditor/api/v1/pdf/pages/duplicate/store
Body Parameters
| Parameter | Data Type | Description |
| Mandatory Parameters | ||
| file | File or String | Upload the PDF file which needs to be password protected 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. |
| input_options | [ { "page_range" : "1, 2-5, 10", "insert_at": "-1" //optional } ]
| page_range - Specify the page numbers that needs to be duplicated from the PDF insert_at (optional) - Specify the position where the duplicated pages needs to be inserted in the PDF. If this key is not passed, the duplicated pages will be inserted after the original page numbers. If this key value is passed as -1, duplicated pages will be inserted at the end of the PDF document. |
| output_settings | { 'folder_id': "<folder_id>" , 'overwrite_existing_file': "<true/false>" }
| 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. |
| Optional Parameters | ||
| password |
String
| If the input PDF is password protected, specify the password to unlock it. |
Note:
- This API will only be available for users who have Zoho WorkDrive Account.
- To use this API, an OAuth token should be generated with the following scopes: ZohoWriter.pdfEditor.ALL,WorkDrive.files.ALL, WorkDrive.organization.ALL
Sample Request
Copiedcurl --location --request POST "https://www.zohoapis.com/pdfeditor/api/v1/pdf/pages/duplicate/store" \
--header "Authorization: Zoho-oauthtoken xxx.yyy.zzz" \
--form 'file=@/Users/username/Documents/Original.pdf' \
--form 'password=abc123' \
--form 'input_options=[{"page_range":"1, 2-5, 10","insert_at":"-1"}]' \
--form 'output_settings={"folder_id": "ap302ef6487b84c45438dae731c5", "overwrite_existing_file": "true"}'
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/pages/duplicate/job/f931a01183b33",
"status": "inprogress"
}
Success Response
Copied{
"document_url" : "https://workdrive.zoho.com/file/ponazfea04477109f4681a831e7177d96bc40",
"document_id" : "ponazfea04477109f4681a831e7177d96bc40",
"status": "success"
}