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: 21.1.0
Syntax
public SaveOutputParameters Save(
Stream stream,
SaveOptions saveOptions
)
Public Function Save (
stream As Stream,
saveOptions As SaveOptions
) As SaveOutputParameters
public:
SaveOutputParameters^ Save(
Stream^ stream,
SaveOptions^ saveOptions
)
member Save :
stream : Stream *
saveOptions : SaveOptions -> SaveOutputParameters
Parameters
- stream
- Type: System.IOStream
Stream where to save the document. - saveOptions
- 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:
SaveOutputParametersAdditional information that you can optionally use.
Examples
Shows how to convert only some of the pages in a document to PDF.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Writeln("Page 1.");
builder.InsertBreak(BreakType.PageBreak);
builder.Writeln("Page 2.");
builder.InsertBreak(BreakType.PageBreak);
builder.Writeln("Page 3.");
using (Stream stream = File.Create(ArtifactsDir + "PdfSaveOptions.OnePage.pdf"))
{
PdfSaveOptions options = new PdfSaveOptions();
options.PageSet = new PageSet(1);
doc.Save(stream, options);
}
See Also