PdfDocumentProcessor.DeletePage(Int32) Method
Deletes the specified page from the document.
Namespace: DevExpress.Pdf
Assembly: DevExpress.Docs.v24.2.dll
NuGet Package: DevExpress.Document.Processor
#Declaration
#Parameters
Name | Type | Description |
---|---|---|
page |
Int32 | The page number (starting with 1). |
#Example
The code sample below deletes odd-numbered pages in a document, starting with the last odd-numbered page.
using DevExpress.Pdf;
using (PdfDocumentProcessor pdfDocumentProcessor = new PdfDocumentProcessor())
{
pdfDocumentProcessor.LoadDocument("..\\..\\docs\\TextDelete.pdf");
for (int i = pdfDocumentProcessor.Document.Pages.Count; i > 0; i--)
if (i % 2 != 0)
{
pdfDocumentProcessor.DeletePage(i);
}
pdfDocumentProcessor.SaveDocument("..\\..\\docs\\Deleted.pdf");
}
#Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the DeletePage(Int32) method.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.