SaveOptions Class

This is an abstract base class for classes that allow the user to specify additional options when saving a document into a particular format.

Inheritance Hierarchy

SystemObject
  Aspose.Words.SavingSaveOptions
    More...

Namespace:  Aspose.Words.Saving
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.9.0

Syntax

public abstract class SaveOptions

The SaveOptions type exposes the following members.

Properties

  NameDescription
Public propertyCode exampleDefaultTemplate
Gets or sets path to default template (including filename). Default value for this property is empty string (Empty).
Public propertyDml3DEffectsRenderingMode
Gets or sets a value determining how 3D effects are rendered.
Public propertyCode exampleDmlEffectsRenderingMode
Gets or sets a value determining how DrawingML effects are rendered.
Public propertyCode exampleDmlRenderingMode
Gets or sets a value determining how DrawingML shapes are rendered.
Public propertyCode exampleMemoryOptimization
Gets or sets value determining if memory optimization should be performed before saving the document. Default value for this property is false.
Public propertyCode examplePrettyFormat
When true, pretty formats output where applicable. Default value is false.
Public propertyCode exampleSaveFormat
Specifies the format in which the document will be saved if this save options object is used.
Public propertyCode exampleTempFolder
Specifies the folder for temporary files used when saving to a DOC or DOCX file. By default this property is null and no temporary files are used.
Public propertyCode exampleUpdateFields
Gets or sets a value determining if fields of certain types should be updated before saving the document to a fixed page format. Default value for this property is true.
Public propertyCode exampleUpdateLastPrintedProperty
Gets or sets a value determining whether the LastPrinted property is updated before saving.
Public propertyCode exampleUpdateLastSavedTimeProperty
Gets or sets a value determining whether the LastSavedTime property is updated before saving.
Public propertyCode exampleUpdateSdtContent
Gets or sets value determining whether content of StructuredDocumentTag is updated before saving.
Public propertyCode exampleUseAntiAliasing
Gets or sets a value determining whether or not to use anti-aliasing for rendering.
Public propertyCode exampleUseHighQualityRendering
Gets or sets a value determining whether or not to use high quality (i.e. slow) rendering algorithms.

Methods

  NameDescription
Public methodStatic memberCode exampleCreateSaveOptions(String)
Creates a save options object of a class suitable for the file extension specified in the given file name.
Public methodStatic memberCode exampleCreateSaveOptions(SaveFormat)
Creates a save options object of a class suitable for the specified save format.
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodToString (Inherited from Object.)

Remarks

An instance of the SaveOptions class or any derived class is passed to the stream Save(Stream, SaveOptions) or string Save(String, SaveOptions) overloads for the user to define custom options when saving a document.

Examples

Shows how to specify saving options while converting a document to .epub.
Document doc = new Document(MyDir + "Rendering.docx");

// Specify encoding for a document that we will save with a SaveOptions object.
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
saveOptions.SaveFormat = SaveFormat.Epub;
saveOptions.Encoding = Encoding.UTF8;

// By default, an output .epub document will have all the contents in one HTML part.
// A split criteria allows us to segment the document into several HTML parts.
// We will set the criteria to split the document at heading paragraphs.
// This is useful for readers which cannot read HTML files greater than a certain size.
saveOptions.DocumentSplitCriteria = DocumentSplitCriteria.HeadingParagraph;

// Specify that we want to export document properties.
saveOptions.ExportDocumentProperties = true;

doc.Save(ArtifactsDir + "HtmlSaveOptions.Doc2EpubSaveOptions.epub", saveOptions);

See Also

Inheritance Hierarchy