Skip to main content

Remove or keep specific pages

POST 

/api/v1/tools/pages

Keep or remove selected pages from a PDF using page specs like "1-3,5,10-".

The referenced input must be a PDF. DOCX and other file types are rejected with a 400 error.

The pages specification is strictly validated. The request will be rejected with a 400 Bad Request and a descriptive error message if:

  • a page spec is syntactically invalid (e.g. contains non-numeric values, such as "1,5-2x")
  • a page range has a descending end (e.g. "5-2" will yield "Invalid page range '5-2': end must be >= start")
  • a page number is outside the valid range for the document (e.g. "Page 10 is out of bounds for document with 8 pages")
  • the same page is selected more than once via overlapping specs (e.g. "1-3,2-4" will yield "Duplicate page selection detected for page 2").

File lifecycle: The input file in the input bucket is deleted after a successful operation.

Request

Responses

Modified PDF returned as binary response