Organize PDF pages
Delete selected pages from a PDF copy
Remove selected PDF pages from a newly generated copy after explicit confirmation, while keeping the original browser-selected document unchanged.
Deletion summary
- Input
- PDF and page selection
- Output
- PDF without selected pages
- Package
- OfficeIMO.Pdf
- Runs on
- Browser-local WebAssembly or .NET
- Microsoft Office
- Not required
- License
- MIT
The browser requires explicit confirmation and never overwrites the selected source file.
Browse all PDF workflowsPractical steps
Remove pages from a downloaded PDF copy
Choose the pages to exclude, confirm the permanent change to the output, and create a separate document.
- SelectChoose one PDF and enter a one-based page expression.
- ConfirmAcknowledge that the selected pages will not exist in the downloaded copy.
- CreateGenerate the new PDF and review the source and output page counts.
Deletion is an output transformation, not an in-place edit. The browser requires confirmation because the selected pages are permanently absent from the downloaded artifact, even though the source remains untouched.
Delete pages from .NET
using OfficeIMO.Pdf;
PdfDocument source = PdfDocument.Load("packet.pdf");
PdfPageSelector pagesToRemove = PdfPageSelector.Parse("2,4-6");
PdfDocument result = source.Pages.Delete(pagesToRemove);
File.WriteAllBytes("packet.cleaned.pdf", result.ToBytes());
Validate the output page count and required content before replacing or archiving any original outside OfficeIMO. Application code owns storage and overwrite policy; the PDF API returns a new document model.
When extraction is clearer
If the business rule identifies pages to keep, use extract pages instead. Expressing the positive selection often makes retention and disclosure workflows easier to review than maintaining a growing exclusion list.