Rearrange pages in a PDF file

This endpoint rearranges pages in a given PDF file based on the specified page order or custom mode. Users can provide a page order as a comma-separated list of page numbers or page ranges, or a custom mode. Input:PDF Output:PDF

The input PDF file

File ID for server-side files (can be used instead of fileInput)

The pages to select, Supports ranges (e.g., '1,3,5-9'), or 'all' or functions in the format 'an+b' where 'a' is the multiplier of the page number 'n', and 'b' is a constant (e.g., '2n+1', '3n', '6n-5')

The custom mode for page rearrangement. Valid values are: CUSTOM: Uses order defined in PageNums DUPLICATE: Duplicate pages n times (if Page order defined as 4, then duplicates each page 4 times)REVERSE_ORDER: Reverses the order of all pages. DUPLEX_SORT: Sorts pages as if all fronts were scanned then all backs in reverse (1, n, 2, n-1, ...). BOOKLET_SORT: Arranges pages for booklet printing (last, first, second, second last, ...). ODD_EVEN_SPLIT: Splits and arranges pages into odd and even numbered pages. ODD_EVEN_MERGE: Merges pages and organises them alternately into odd and even pages. REMOVE_FIRST: Removes the first page. REMOVE_LAST: Removes the last page. REMOVE_FIRST_AND_LAST: Removes both the first and the last pages.

ILovePDF Tools - Quick Access
Scroll to Top