GdPicture.NET.14.API
GdPicture14 Namespace / GdPictureDocumentConverter Class / SaveAsMarkDown Method / SaveAsMarkDown(Stream) Method
A stream object where the current document will be saved to as a Markdown 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
SaveAsMarkDown(Stream) Method
In This Topic
This method converts the currently loaded document to Markdown and saves it to an instantiated stream object.
Syntax
'Declaration
 
Public Overloads Function SaveAsMarkDown( _
   ByVal Stream As Stream _
) As GdPictureStatus
public GdPictureStatus SaveAsMarkDown( 
   Stream Stream
)
public function SaveAsMarkDown( 
    Stream: Stream
): GdPictureStatus; 
public function SaveAsMarkDown( 
   Stream : Stream
) : GdPictureStatus;
public: GdPictureStatus SaveAsMarkDown( 
   Stream* Stream
) 
public:
GdPictureStatus SaveAsMarkDown( 
   Stream^ Stream
) 

Parameters

Stream
A stream object where the current document will be saved to as a Markdown 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 Markdown 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.markdown", FileMode.OpenOrCreate, FileAccess.ReadWrite);
            
status = converter.SaveAsMarkDown(fs);
if (status != GdPictureStatus.OK)
{
    throw new Exception(status.ToString());
}
            
Console.WriteLine("The input document has been converted to a markdown file");
See Also