
Delete Pages from a PDF to Sanitize Documents
Delete Unneeded Pages from a PDF
Documents often contain pages that should not go to every recipient. A case report may include a confidential appendix, a financial package may contain management-only analysis, or a long report may need a shorter customer-facing edition. Removing those pages manually becomes slow and inconsistent when the same kind of document is produced repeatedly.
Development teams need a dependable way to delete pages as part of the document workflow that already creates, prepares, and delivers PDFs. The solution should be simple enough for one-off requests and flexible enough to support different versions of the same document for customers, partners, and internal teams.
Delete PDF Pages Easily with pdfRest
pdfRest supports PDF page deletion through the Split PDF API Tool. Split PDF was designed for a range of page-based document workflows, including creating excerpts, separating sections, producing audience-specific editions, and removing pages that do not belong in the final file.
The application defines the pages that should remain, and pdfRest returns a new PDF containing that selected set. This gives document systems a straightforward API-based way to delete pages without asking someone to open, edit, and resave every file by hand.
How Split PDF Removes the Pages You Do Not Need
Split PDF can take one input PDF and produce many output PDFs—for example, separate a report into individual sections. It can also take one input PDF and produce one output PDF. That one-to-one workflow is what makes page deletion possible: specify the pages to keep in the single output, and pdfRest creates the new document without the pages left out of the selection.
For example, keep 1-9,11-last to remove page 10. The output includes pages 1 through 9 and pages 11 through the end of the document; because page 10 is not selected for the one output PDF, it is excluded.
Page expressions support individual pages, comma-separated selections, ranges, and the last keyword. Keep 1-5 to create a shareable excerpt, or use multiple ranges to omit several pages from a longer report. The same API operation can therefore generate different approved editions from one document according to recipient role, case status, or another application rule.
Use Redaction When Retained Pages Also Contain Sensitive Text
Page deletion remains the direct solution when an entire page does not belong in the delivered PDF. In some workflows, retained pages also contain individual values that cannot be shared. In that case, the Redact PDF API Tool can identify text using exact terms, built-in patterns, or custom regular expressions, produce a preview, and apply the approved redactions so the targeted content is removed from the resulting PDF.
This layered approach lets each tool perform the operation it is designed for. Split PDF controls which pages enter the shareable copy. Redact PDF removes specified text from the pages that remain. A document policy can separately account for metadata, annotations, attachments, and the retention of source files, giving the application an explicit workflow instead of treating “sanitization” as one ambiguous action.
For example, a public-records system can start with a 30-page case report, omit a five-page confidential appendix, and redact personal identifiers that also appear in the retained summary. The system produces a focused external edition for the requested disclosure while retaining only the pages and information appropriate for that audience.
Automate Audience-Specific Document Editions
Split PDF accepts either an uploaded file or the resource ID returned by an earlier pdfRest operation. The response provides a new resource ID for the selected-page output, which can pass directly to Redact PDF or another approved step without downloading and uploading an intermediate file.
This makes the workflow suitable for portals, records systems, legal applications, and regulated document pipelines that repeatedly produce internal, partner, and public versions. Page-selection rules can come from document metadata, case status, recipient role, or another business rule already maintained by the application.
After the required output has been delivered or stored, the optional Delete Files API Tool can remove uploaded and generated resources before the normal retention period. That gives sensitive workflows direct control over both document contents and the processing-file lifecycle.
Delete a PDF Page with Split PDF
The following cURL request keeps every page except page 10 and names the resulting shareable copy.
Delete Page 10 from a PDF Code Example | Load this into API Lab↗
# By default, this request uses the US-based API service. API_URL="https://api.pdfrest.com" # For the EU-based service, use: # API_URL="https://eu-api.pdfrest.com" curl -X POST "$API_URL/split-pdf" \ -H "Accept: application/json" \ -H "Content-Type: multipart/form-data" \ -H "Api-Key: xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" \ -F "file=@/path/to/case_report.pdf" \ -F "pages[]=1-9,11-last" \ -F "output=sanitized_share_copy"
Use API Lab to configure page ranges. The Split PDF, Redact PDF, and Delete Files references provide the current request fields for each layer.
|
Split PDF |