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.1
Syntax
public abstract class SaveOptions

The SaveOptions type exposes the following members.

Constructors
  NameDescription
Protected methodSaveOptions
Initializes a new instance of the SaveOptions class
Properties
  NameDescription
Public propertyCode exampleDefaultTemplate
Gets or sets path to default template (including filename). Default value for this property is empty string (Empty).
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 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.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (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
Converts a document to EPUB with save options specified.
// Open an existing document from disk
Document doc = new Document(MyDir + "Document.EpubConversion.doc");

// Create a new instance of HtmlSaveOptions. This object allows us to set options that control
// how the output document is saved
HtmlSaveOptions saveOptions = new HtmlSaveOptions();

// Specify the desired encoding.
saveOptions.Encoding = Encoding.UTF8;

// Specify at what elements to split the internal HTML at. This creates a new HTML within the EPUB 
// which allows you to limit the size of each HTML part. This is useful for readers which cannot read 
// HTML files greater than a certain size e.g 300kb
saveOptions.DocumentSplitCriteria = DocumentSplitCriteria.HeadingParagraph;

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

// Specify that we want to save in EPUB format
saveOptions.SaveFormat = SaveFormat.Epub;

// Export the document as an EPUB file
doc.Save(ArtifactsDir + "Document.EpubConversion.epub", saveOptions);
See Also
Inheritance Hierarchy