DocumentSave(Stream, SaveOptions) Method

Saves the document to a stream using the specified save options.

Namespace:  Aspose.Words
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.7.0


public SaveOutputParameters Save(
	Stream stream,
	SaveOptions saveOptions


Type: System.IOStream
Stream where to save the document.
Type: Aspose.Words.SavingSaveOptions
Specifies the options that control how the document is saved. Can be null. If this is null, the document will be saved in the binary DOC format.

Return Value

Type: SaveOutputParameters
Additional information that you can optionally use.


Converts just one page (third page in this example) of the document to PDF.
Document doc = new Document(MyDir + "Rendering.docx");

using (Stream stream = File.Create(ArtifactsDir + "Rendering.SaveToPdfStreamOnePage.pdf"))
    PdfSaveOptions options = new PdfSaveOptions();
    options.PageIndex = 2;
    options.PageCount = 1;
    doc.Save(stream, options);

See Also