Split PDF
POST https://api.pdfrest.com/split-pdf
Split a PDF document into one or more PDF files.
Required form-data body parameters:
- One of:
file
- File to be uploaded and processedid
- Alphanumeric ID (UUID) of existing file on server to be processed
Optional form-data body parameters:
output
- Specifies the prefix of the generated output file name(s), without extension. A sequentially incremented number will be appended to the end of this prefix for each output file name. If this parameter is not specified, the original input file name will be used as the output prefix.pages[]
- Indicates the pages to use from the input document to create an output document. Accepts page numbers and/or ranges separated by commas. In addition,pages[]
supports several keywords: even, odd, and last. Examples of valid values forpages[]
include:- 14-last (will merge using only the range of pages from page 14 to the end of the document)
- 9-2 (will use pages 2 to 9 in reverse order)
- 1,2,5-10,12-last
- even (will use only the even-numbered pages from this document)
- odd (will use only the odd-numbered pages from this document)
Notes on pages[]
:
- Multiple instances of
pages[]
will yield multiple output documents; see the Examples folder. - If
pages[]
is omitted from a request, then the input PDF will be split into a single document for each page in the original document. For example, a ten-page PDF would result in ten new PDFs, each consisting of one page from the original document.
Request Body
[{"name"=>"file", "value"=>nil, "datatype"=>"null"}, {"name"=>"id", "value"=>"xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "datatype"=>"string"}, {"name"=>"pages[]", "value"=>"1,3,4-6", "datatype"=>"string"}, {"name"=>"output", "value"=>"pdfrest_split_pdf", "datatype"=>"string"}]
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
Api-Key | string |