C# PowerPoint Library
How to use XDoc.PowerPoint in C# application?
Overview for How to Use XDoc.PowerPoint in C# .NET Programming Project
RasterEdge XDoc.PowerPoint has provided three ways to create PowerPoint document object that are load from file, load from stream and load from byte array. Conversely, the PowerPoint SDK can also save PowerPoint document object to file, stream or byte array.
How to read, save Microsoft Office PowerPoint document using C#?
Download XDoc.PowerPoint C# PPTX document library
Install C# PPTX library to load, export Microsoft PowerPoint file in .NET applications
Load PowerPoint Document From Existing File Using C#
You may also load or create a PowerPoint document object from existing PowerPoint file in C#.net.
// Load from a fileStringinputFilePath=Program.RootPath+"\\"+"1.pptx";PPTXDocumentdoc=newPPTXDocument(inputFilePath);if(doc==null)thrownewException("fail to load the file");// ...
Load PowerPoint From Stream Object in C# Project
PowerPoint document can be loaded from a stream object in C# programming.
// Load from a streamStringinputFilePath=Program.RootPath+"\\"+"2.pptx";using(FileStreamfileStream=File.Open(inputFilePath,FileMode.Open,FileAccess.Read)){PPTXDocumentdoc=newPPTXDocument(fileStream);if(doc==null)thrownewException("fail to load PowerPoint document from the stream");// ...}
Load PowerPoint From Byte Array Object in C# Project
PowerPoint document can be loaded from a stream object in C# programming.
// Load from a streamStringinputFilePath=Program.RootPath+"\\"+"2.pptx";using(FileStreamfileStream=File.Open(inputFilePath,FileMode.Open,FileAccess.Read)){byte[]array=newbyte[fileStream.Length];fileStream.Read(array,0,array.Length);PPTXDocumentdoc=newPPTXDocument(fileStream);if(doc==null)thrownewException("fail to load PowerPoint document from the stream");// ...}
Save PowerPoint Document To File in C# Project
PowerPoint document can be saved to a PowerPoint file in C# programming.
StringinputFilePath=Program.RootPath+"\\"+"2.pptx";StringoutputFilePath=Program.RootPath+"\\"+"output.pptx";PPTXDocumentdoc=newPPTXDocument(fileStream);if(doc==null)thrownewException("fail to load PowerPoint document from the stream");// Save document to a Powerpoint filedoc.Save(outputFilePath);
Save PowerPoint Document To Stream Object in C# Project
PowerPoint document can be saved to a stream object in C# programming.
StringinputFilePath=Program.RootPath+"\\"+"2.pptx";Streamstream=newMemoryStream();PPTXDocumentdoc=newPPTXDocument(fileStream);if(doc==null)thrownewException("fail to load PowerPoint document from the stream");// Save document to a stream objectdoc.SaveToStream(stream);
Save PowerPoint Document To Byte Array in C# Project
PowerPoint document can be saved to a byte array object in C# programming.
StringinputFilePath=Program.RootPath+"\\"+"2.pptx";PPTXDocumentdoc=newPPTXDocument(inputFilePath);if(doc==null)thrownewException("fail to load PowerPoint document from the stream");// Save document to a byte array objectbyte[]array=doc.SaveToByte();