C#: Online Guide
How To: powerpoint SDK
Page: Extract PowerPoint Pages
Page: Extract PowerPoint Pages
  |  
Home ›› XDoc.PowerPoint ›› C# PowerPoint: Extract PowerPoint Pages

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


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




Overview



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.


Related .net document control helps:
asp.net excel view: ASP.NET Excel Viewer in C# Control (MVC & WebForms): view Office Excel document in web browser.
powerpoint viewer asp.net mvc: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET
asp.net pdf editor control: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
asp.net edit pdf text color: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
mvc pdf editor: ASP.NET MVC PDF Viewer & Editor: view, annotate, redact, edit PDF document in C# ASP.NET MVC
document viewer asp.net c#: ASP.NET Document Viewer using C#: Open, View, Annotate, Redact, Convert document files in ASP.NET using C#, HTML5, JQuer...
mvc document viewer: ASP.NET MVC Document Viewer: view, annotate, redact files on ASP.NET MVC web projects


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.




C# DLLs: Extract PowerPoint Page



Add necessary XDoc.PowerPoint DLL libraries into your created C# application as references.


  RasterEdge.Imaging.Basic.dll


  RasterEdge.XDoc.Office.Inner.Common.dll


  RasterEdge.Imaging.Drawing.dll


  RasterEdge.Imaging.Processing.dll


  RasterEdge.XDoc.Office.Inner.Office03.dll


  RasterEdge.Imaging.Font.dll


  RasterEdge.XDoc.PowerPoint.dll


  RasterEdge.XImage.Raster.Core.dll


  RasterEdge.XImage.Raster.dll


Use corresponding namespaces;


  using RasterEdge.Imaging.Basic;


  using RasterEdge.XDoc.PowerPoint;




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");