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

C# PowerPoint Library
Extract or Copy PowerPoint Pages from PowerPoint File in C#.NET


Extract/Copy PowerPoint Pages of PowerPoint Document in C# Project



The Microsoft Office PowerPoint, known as PowerPoint document, is a widely-used form of file that allows users to open & read documents even though they are using different types of PowerPoint processors. Besides, the capacity to be locked against editing or processing by others makes PowerPoint file become increasingly popular among large enterprises and organizations.

Using this C#.NET PowerPoint document page extract library control, developers can extract pages from PowerPoint document. Using the library, you should be sure that the page index is valid.


Extract PowerPoint Pages Using C#

You may choose extract pages of PowerPoint file and save to PowerPoint file.

PPTXDocument doc = new PPTXDocument(@"C:\1.pptx");
int[] pageIndexes = new int[] { 1, 3};
doc.ExtractPages(pageIndexes, @"C:\extract.pptx");


Copy and Append PowerPoint Pages to Another PowerPoint File Using C#

You may copy pages of PowerPoint file and paste to another PowerPoint file.

PPTXDocument doc = new PPTXDocument(@"C:\1.pptx");
int[] pageIndexes = new int[] { 1, 3};
Stream stream = new MemoryStream();
//extract pages to stream
doc.ExtractPages(pageIndexes, stream);
FileStream fileStream = File.Open(@"C:\2.pptx", FileMode.Open);
//paste the pages extracted to second word file
PPTXDocument.CombineDocument(new Stream[] { stream, fileStream }, @"C:\copy.pptx");