XDoc.PowerPoint
Features
Tech Specs
How-to C#
Pricing

C# PowerPoint Library
Delete PowerPoint Document Page in C#.NET


Provides Users with Mature Document Manipulating Function for Deleting PowerPoint Pages



C#.NET PowerPoint document page deleting library control (XDoc.PowerPoint) can be easily integrated into any C#.NET class applications to delete any unnecessary page from target existing PowerPoint document file. Using RasterEdge Visual C# .NET PowerPoint page deletion component, developers can easily select one or more PowerPoint pages and delete it/them in both .NET web and Windows applications.

C#.NET PowerPoint page removing & deleting library control SDK is a mature component on the market, which can also provides other PowerPoint document page processing functions, such as PowerPoint document merging function, PowerPoint page rotating function, PowerPoint page insert function, PowerPoint page reordering function and PowerPoint document splitting function.

This tutorial offers three pieces of C# sample codes for PowerPoint page(s) deletion. XDoc.PowerPoint enables you to delete PowerPoint page(s) with customized options, including setting a single page, a series of pages, and random pages to be removed from PowerPoint file.


Delete a Single PowerPoint Page from PowerPoint File in C#

How to delete a single page from a PowerPoint document.

String filepath = @"";
String outPutFilePath = @"";
PPTXDocument doc = new PPTXDocument(filepath);

// Detele page 2 (actually the third page).
doc.DeletePage(2);

// Save the file.
doc.Save(outPutFilePath);


Delete Consecutive Pages from PowerPoint in C#

How to delete a range of pages from a PowerPoint document.

String filepath = @"";
String outPutFilePath = @"";
PPTXDocument doc = new PPTXDocument(filepath);

// Detele a series of 3 pages, starting from the second page. 
doc.DeletePages(1, 3);

// Save the file.
doc.Save(outPutFilePath);


Delete Specified Pages from PowerPoint in C#

How to delete several defined pages from a PowerPoint document.

String filepath = @"";
String outPutFilePath = @"";
PPTXDocument doc = new PPTXDocument(filepath);

// Get PageIndexes.
int[] detelePageindexes = new int[] { 1, 3, 5, 7, 9 };

// Delete pages.
doc.DeletePages(detelePageindexes);

// Save the file.
doc.Save(outPutFilePath);