Presentation(Stream) Constructor
Initializes a new instance of the Presentation class with specified settings.
Namespace: DevExpress.Docs.Presentation
Assembly: DevExpress.Docs.Presentation.v25.1.dll
NuGet Package: DevExpress.Docs.Presentation
Declaration
Parameters
| Name | Type | Description |
|---|---|---|
| stream | Stream | A stream that contains a presentation (PPTX). |
Remarks
The following code snippet loads a presentation from a stream:
using DevExpress.Docs.Presentation;
namespace PresentationApiSample;
public class Program {
public static void Main(string[] _) {
// Load a presentation from a stream
using (FileStream fs = File.OpenRead(@"D:\mypresentation.pptx")) {
Presentation presentation = new Presentation(fs);
// Do something with the presentation. For example, export it:
presentation.ExportToPdf(new FileStream(@"D:\exported-document.pdf", FileMode.Create));
}
}
}
Note: If you try to load a corrupted PPTX file or file in another format, you get a PresentationUnsupportedFormatException.
For more information, refer to the following help topic: DevExpress Presentation API Library: Create, Load, and Save Presentations.
See Also