GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureDocumentConverter Class / SaveAsPPTX Method / SaveAsPPTX(Stream) Method
A stream object where the current document will be saved to as a PPTX file. This stream object must be initialized before passing it to this method and it should stay open for subsequent use.

If the output stream is not opened for both reading and writing, the method will fail to return the GdPictureStatus.InvalidParameter status.

Example





In This Topic
SaveAsPPTX(Stream) Method
In This Topic
This method converts the currently loaded document to PPTX and converts it to an instantiated stream object.
Syntax
'Declaration
 
Public Overloads Function SaveAsPPTX( _
   ByVal Stream As Stream _
) As GdPictureStatus
public GdPictureStatus SaveAsPPTX( 
   Stream Stream
)
public function SaveAsPPTX( 
    Stream: Stream
): GdPictureStatus; 
public function SaveAsPPTX( 
   Stream : Stream
) : GdPictureStatus;
public: GdPictureStatus SaveAsPPTX( 
   Stream* Stream
) 
public:
GdPictureStatus SaveAsPPTX( 
   Stream^ Stream
) 

Parameters

Stream
A stream object where the current document will be saved to as a PPTX file. This stream object must be initialized before passing it to this method and it should stay open for subsequent use.

If the output stream is not opened for both reading and writing, the method will fail to return the GdPictureStatus.InvalidParameter status.

Return Value

A member of the GdPictureStatus enumeration. If processing is successful, then the return value is GdPictureStatus.OK.
Remarks
Note that the output stream should be open for both reading and writing and should be closed/disposed by the user once processing is complete.
Example
Converting and saving a PDF document to a PPTX file using a stream.
using GdPicture14;
            
using GdPictureDocumentConverter converter = new();
            
var status = converter.LoadFromFile("input.pdf");
if (status != GdPictureStatus.OK)
{
    throw new Exception(status.ToString());
}
            
using var fs = new FileStream("output.pptx", FileMode.OpenOrCreate, FileAccess.ReadWrite);
            
status = converter.SaveAsPPTX(fs);
if (status != GdPictureStatus.OK)
{
    throw new Exception(status.ToString());
}
            
Console.WriteLine("The input document has been converted to a pptx file");
See Also