Delete PDF Pages. Remove pages from a PDF document.

PDF deletion is removing one or more pages from a PDF document.

.NET PDF deleting control allows developers to permanently delete the unnecessary pages or blank page from a PDF. C# PDF removing library can delete a group of unwanted pages from PDF in multiple Visual .NET applications, such as C#, VB.NET, ASP.NET and WinForms.

This online guide shows you how to delete costomized number of pages from PDF using C# language.


// Open the original pdf file
PdfDocument document = PdfReader.Open("file1.pdf", PdfDocumentOpenMode.Modify);

for (int i = document.PageCount - 1; i >= 0; i--)
{
    // Delete all the even pages from pdf
    if (i % 2 == 0)
    {
        document.Pages.RemoveAt(i);
    }
}

// Save and show the document           
document.Save("Removed.pdf");
Process.Start("Removed.pdf");

More PDF tutorial