officefileapi-devexpress-dot-docs-dot-presentation-dot-presentation-dot-ctor-x28-system-dot-byte-x29.md
Initializes a new instance of the Presentation class with specified settings.
Namespace : DevExpress.Docs.Presentation
Assembly : DevExpress.Docs.Presentation.v25.2.dll
NuGet Package : DevExpress.Docs.Presentation
public Presentation(
byte[] buffer
)
Public Sub New(
buffer As Byte()
)
| Name | Type | Description |
|---|---|---|
| buffer | Byte[] |
A presentation as a byte array.
|
The following code snippet loads a presentation (PPTX file) from a byte array:
using DevExpress.Docs.Presentation;
namespace PresentationApiSample;
public class Program {
public static void Main(string[] _) {
// Load a presentation from a byte array
Presentation presentation = new Presentation(File.ReadAllBytes(@"D:\mypresentation.pptx"));
}
}
Imports DevExpress.Docs.Presentation
Namespace PresentationApiSample
Public Class Program
Public Shared Sub Main(__ As String())
' Load a presentation from a byte array
Dim presentation As Presentation = New Presentation(File.ReadAllBytes("D:\mypresentation.pptx"))
End Sub
End Class
End Namespace
Note : If you try to load a corrupted presentation file or file in unsupported 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