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.

ExpandedInheritance Hierarchy

SystemObject
  Aspose.Words.SavingSaveOptions
    More...

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

ExpandedSyntax

public abstract class SaveOptions

The SaveOptions type exposes the following members.

ExpandedProperties

  NameDescription
Public propertyCode exampleAllowEmbeddingPostScriptFonts
Gets or sets a boolean value indicating whether to allow embedding fonts with PostScript outlines when embedding TrueType fonts in a document upon it is saved. The default value is false.
Public propertyCustomTimeZoneInfo
Gets or sets custom local time zone used for date/time fields.
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 propertyUpdateCreatedTimeProperty
Gets or sets a value determining whether the CreatedTime property is updated before saving. Default value is false;
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.

ExpandedMethods

  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
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)

ExpandedRemarks

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.

ExpandedExamples

Shows how to use a specific encoding when saving a document to .epub.
Document doc = new Document(MyDir + "Rendering.docx");

// Use a SaveOptions object to specify the encoding for a document that we will save.
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
saveOptions.SaveFormat = SaveFormat.Epub;
saveOptions.Encoding = Encoding.UTF8;

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

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

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

ExpandedSee Also

ExpandedInheritance Hierarchy