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:
c# asp.net document annotation: ASP.NET Document Annotation Control: text comment, drawing on files online using ASP.NET component
view file asp.net: View multiple document formats in ASP.NET, MVC, Ajax, Azure using C# control
asp.net pdf file permission using c#: ASP.NET PDF File Permission Control: apply, remove PDF file permission settings in C#
asp.net edit pdf page using c#: ASP.NET PDF Pages Edit Control: add, remove, sort, replace PDF pages online using C#
c# asp.net sharepoint document viewer: ASP.NET SharePoint Document Viewer: view, annotate, redact documents in SharePoint
c# asp.net iis document viewer: C# HTML5 Viewer: Deployment on IIS
c# asp.net document redaction: Redact document ASP.NET: add, delete, apply redaction on PDF files in web browser using C#.net


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