Back to Devexpress

Presentation.SaveDocument(Stream) Method

officefileapi-devexpress-dot-docs-dot-presentation-dot-presentation-dot-savedocument-x28-system-dot-io-dot-stream-x29.md

latest2.7 KB
Original Source

Presentation.SaveDocument(Stream) Method

Saves the presentation to a stream.

Namespace : DevExpress.Docs.Presentation

Assembly : DevExpress.Docs.Presentation.v25.2.dll

NuGet Package : DevExpress.Docs.Presentation

Declaration

csharp
public void SaveDocument(
    Stream stream
)
vb
Public Sub SaveDocument(
    stream As Stream
)

Parameters

NameTypeDescription
streamStream

A stream to which the presentation should be saved.

|

Remarks

The following code snippet saves the created presentation as a PPTX file:

csharp
using DevExpress.Docs.Presentation;

namespace PresentationApiSample;

public class Program {
    public static void Main(string[] _) {
        // Create a presentation
        Presentation presentation = new Presentation();
        //...
        // Populate the presentation with content
        //...
        // Save the modified presentation to a new PPTX file
        FileStream outputStream = new FileStream(@"D:\\resulting-presentation.pptx", FileMode.Create);
        presentation.SaveDocument(outputStream);
        outputStream.Dispose();
    }
}
vb
Imports DevExpress.Docs.Presentation

Namespace PresentationApiSample

    Public Class Program
        Public Shared Sub Main(__ As String())

            ' Create a presentation
            Dim presentation As Presentation = New Presentation()
            '...
            ' Populate the presentation with content
            '...
            ' Save the modified presentation to a new PPTX file
            Dim outputStream As FileStream = New FileStream("D:\\resulting-presentation.pptx", FileMode.Create)
            presentation.SaveDocument(outputStream)
            outputStream.Dispose()

        End Sub
    End Class
End Namespace

See Also

DevExpress Presentation API Library: Create, Load, and Save Presentations

Presentation Class

Presentation Members

DevExpress.Docs.Presentation Namespace