Delete Unwanted Pages
Organize → Delete Unwanted Pages
The Delete Unwanted Pages API removes specified pages from a PDF. You send the PDF (docContent Base64, docName), pageNumbers (e.g. 2, 1,3,5, 2-4), and optionally async. The API returns the PDF without those pages. Use the tester below to try it; more details are in the sections that follow.
Try the Delete Unwanted Pages API
Endpoint: POST /api/v2/DeletePages · Required: api-key, docContent, docName, pageNumbers
Use the form below to send your API key, PDF (Base64), and page numbers or ranges to delete. The response is the PDF with those pages removed. No code required—fill the fields and click Send request.
Overview, parameters, and use cases
- Overview
- Parameters
- Use cases
What is Delete Unwanted Pages?
This endpoint removes specified pages from a PDF. You provide pageNumbers: single page (e.g. 2), multiple pages (e.g. 1,3,5), or a range (e.g. 2-4). The API returns a new PDF without those pages. Use it when you need to drop specific pages (e.g. cover, appendix) from a document.
Page selection format
- Single page: e.g. 2
- Multiple pages: e.g. 1,3,5
- Page range: e.g. 2-4
Use when removing specific pages by number. For removing blank pages by criteria use Delete Blank Pages; for keeping only certain pages use Extract Pages.
API parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| api-key | string | Yes | Your PDF4me API key, Base64 encoded. Get it from the dashboard. |
| docContent | base64 | Yes | PDF file content (Base64). |
| docName | string | Yes | Output PDF file name (e.g. output.pdf). |
| pageNumbers | string | Yes | Pages to delete: 2, 1,3,5, 2-4. |
| async | boolean | No | Enable asynchronous processing. |
When to use Delete Unwanted Pages
- Remove specific pages – Drop cover, appendix, or unwanted pages by number.
- Cleanup – Remove duplicate or obsolete pages from a PDF.
- Subset creation – Create a shorter PDF by deleting selected pages.
For request/response schemas and code samples, see Delete Pages in the PDF4me API docs.
Prerequisites
Before using this endpoint, make sure you have:
- A valid PDF4me API key (Get your API Key)
- A PDF file in Base64 format
Response Format
The API returns a PDF file with the specified pages removed.