iLovePDF Developers
Log in Sign up

Split PDF Guide
How to integrate the Split PDF tool into your application using iLovePDF’s REST API.

Remember that in order to use our Tool Guides, you need to have previous knowledge about the basics to processing a PDF with our REST API. We strongly recommend that you read the Processing a PDF guide before starting this one.

Basic split

There are several ways to split a PDF but the most simple one is by defining ranges of pages to split:

Basic split

The property ranges can define multiple page ranges to split your document. You’ll have as a result a packaged file to download with as many files as ranges you have set.


According to this code example, the final output will be of two zipped PDF files. One will contain the pages from 2 to 4 and the other will contain pages 6 to 8.


Note that if you set a range greater than the maximum number of pages in your document, you will get as many pages as can be split from this document. However, if your range starts with a page number greater than the number of pages in your document, you will receive an error and the process will fail.

Advanced split

We have seen how to split a document by page ranges, but there are more ways to split. See the following:

Split by fixed ranges

Split by fixed ranges

fixed_range will split your PDF every n pages. If you set a bigger fixed range number than the number of pages in your document, you will receive an error.

Split by removing pages

Split by removing pages

remove_pages allows you to set ranges of pages to be removed from your document and the resulting file comes back as a single PDF without the specified pages.

If you set a range as big as the number of pages in your document, you will receive an error.

Merge after split

Merge after split

When you split a document by setting specific ranges you can merge all these ranges together in a single file with merge_after. You will get as a result a single PDF file.