Split PDF

Split PDF

Split PDF is a REST API tool that separates a single PDF file into any number of separate PDF files, each with specified pages.

A bubbling flask with code brackets inside
Try Now with API Lab

Start right from your browser - upload files, choose parameters, generate code, and send API Calls directly from API Lab!  

to receive your free API Key.
Required Parameters
curl -X POST "https://api.pdfrest.com/split-pdf" \ 
  -H "Accept: application/json" \ 
  -H "Content-Type: multipart/form-data" \
  -H "Api-Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
The response for your API Call will display here.
Once you've sent your POST request and received a valid response, you can download your output file using the output URL.

Why is pdfRest the best API to split PDF?

pdfRest offers the best solution for splitting a PDF input into multiple PDF outputs, because it supports flexible page ranges, optimized content, and deleting or exporting pages.

Page Range Power

Easily split a 100-page PDF into 100 one-page PDFs, or pick and choose each output PDF you’d like to create from the original PDF source.  Maybe you need pages 1-10 in a file, pages 2,5,15-20 in another file, all the even page numbers in a third file, and pages 25-50 in reverse order in a fourth file.  No problem - every possible permutation of pages can be saved out to any number of target output files with one single API Call.

Optimized Content

When pages are split out from PDFs with many PDF tools in the wild, some of the “removed” content can actually be left behind in the file. This might not appear to users when viewing the document, but a rogue embedded font can easily linger around without serving a purpose for the pages that remain in the new, smaller file.

pdfRest to the rescue! Every split-out PDF created by the Split PDF tool is optimized to contain only the relevant content for the pages in that file. Smaller file sizes, faster user experience.

Export or Delete Pages

pdfRest’s Split PDF tool can be used to save many output files, but it also can be used to simply save one output PDF with just the page or pages you need. This allows you to isolate just the content you need in a streamlined document.

Export all the pages you need into your one output file, or select all pages other than the ones you’d like to delete. The Split PDF tool serves many functions.
Start from Code Examples
  1. First, you'll need an API Key - to:
    • Stay anonymous with a Guest API Key for 10 free API Calls
    • Sign up for an upgraded API Key with unlimited, continuous service
  2. Choose your programming language
  3. Copy and paste the code to your project
  4. Update Api-Key field with your unique API Key
  5. Update file with the local path to your input
  6. Run this code to send an API Call
See more code examples in our
GitHub repository
Try pdfRest with just a few clicks
Download our Postman Postman Collection
curl -X POST "https://api.pdfrest.com/split-pdf" \
  -H "Accept: application/json" \
  -H "Content-Type: multipart/form-data" \
  -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \
  -F "file=@../Sample_Input/PDFToBeSplit.pdf" \
  -F "output=example_out" \
  -F "pages[]=1-4" \
  -F "pages[]=2" \
  -F "pages[]=4,6-3"
Customize Your Solution

The pages[] parameter allows you to identify pages and/or page ranges that you would like to split into one or more new PDFs. This is a versatile parameter that allows you to precisely construct your output document(s) by specifying the exact pages, page order, and number of documents that you want.

Each instance of pages[]creates one new output PDF containing the specified pages. For example, the values “3”, “4-10”, and “2,3,4” will create three new PDFs, each containing the pages that were specified for that particular document.

If a page number is included more than once (e.g., “1,2,3,3,4,5”), then the page will be duplicated in the output file. Pages may also be reordered (e.g., “1,5,3,2,4”), and page ranges may be reversed by listing the higher page number first (e.g., “2,4,9-5,12”).

pages[] also accepts a few keywords to quickly identify pages to split. The keywords “even” and “odd” will select only those pages to split into a new PDF, and the keyword “last” may be used to represent the final page of the input PDF.

One trick using pages[] is to effectively delete one or more pages from a document. For example, the value “1-5,7-last” will create a new document without page 6.

(If pages[] is omitted entirely, the default behavior is to split the input PDF into one document for each page.)

Generate a self-service API Key now!

Create your FREE API Key to start processing PDFs in seconds, only possible with pdfRest.

Compare Plans
Contact Us