WordML2003SaveOptions Class

Can be used to specify additional options when saving a document into the WordML format.

ExpandedInheritance Hierarchy

SystemObject
  Aspose.Words.SavingSaveOptions
    Aspose.Words.SavingWordML2003SaveOptions

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

ExpandedSyntax

public class WordML2003SaveOptions : SaveOptions

The WordML2003SaveOptions type exposes the following members.

ExpandedConstructors

  NameDescription
Public methodWordML2003SaveOptions
Initializes a new instance of the WordML2003SaveOptions class

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.
(Inherited from SaveOptions.)
Public propertyCustomTimeZoneInfo
Gets or sets custom local time zone used for date/time fields.
(Inherited from SaveOptions.)
Public propertyCode exampleDefaultTemplate
Gets or sets path to default template (including filename). Default value for this property is empty string (Empty).
(Inherited from SaveOptions.)
Public propertyDml3DEffectsRenderingMode
Gets or sets a value determining how 3D effects are rendered.
(Inherited from SaveOptions.)
Public propertyCode exampleDmlEffectsRenderingMode
Gets or sets a value determining how DrawingML effects are rendered.
(Inherited from SaveOptions.)
Public propertyCode exampleDmlRenderingMode
Gets or sets a value determining how DrawingML shapes are rendered.
(Inherited from SaveOptions.)
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.
(Inherited from SaveOptions.)
Public propertyCode examplePrettyFormat
When true, pretty formats output where applicable. Default value is false.
(Inherited from SaveOptions.)
Public propertyCode exampleSaveFormat
Specifies the format in which the document will be saved if this save options object is used. Can only be WordML.
(Overrides SaveOptionsSaveFormat.)
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.
(Inherited from SaveOptions.)
Public propertyUpdateCreatedTimeProperty
Gets or sets a value determining whether the CreatedTime property is updated before saving. Default value is false;
(Inherited from SaveOptions.)
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.
(Inherited from SaveOptions.)
Public propertyCode exampleUpdateLastPrintedProperty
Gets or sets a value determining whether the LastPrinted property is updated before saving.
(Inherited from SaveOptions.)
Public propertyCode exampleUpdateLastSavedTimeProperty
Gets or sets a value determining whether the LastSavedTime property is updated before saving.
(Inherited from SaveOptions.)
Public propertyCode exampleUpdateSdtContent
Gets or sets value determining whether content of StructuredDocumentTag is updated before saving.
(Inherited from SaveOptions.)
Public propertyCode exampleUseAntiAliasing
Gets or sets a value determining whether or not to use anti-aliasing for rendering.
(Inherited from SaveOptions.)
Public propertyCode exampleUseHighQualityRendering
Gets or sets a value determining whether or not to use high quality (i.e. slow) rendering algorithms.
(Inherited from SaveOptions.)

ExpandedMethods

  NameDescription
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

At the moment provides only the SaveFormat property, but in the future may have other options added.

ExpandedExamples

Shows how to manage memory optimization.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Writeln("Hello world!");

// Create a "WordML2003SaveOptions" object to pass to the document's "Save" method
// to modify how we save the document to the WordML save format.
WordML2003SaveOptions options = new WordML2003SaveOptions();

// Set the "MemoryOptimization" flag to "true" to decrease memory consumption
// during the document's saving operation at the cost of a longer saving time.
// Set the "MemoryOptimization" flag to "false" to save the document normally.
options.MemoryOptimization = memoryOptimization;

doc.Save(ArtifactsDir + "WordML2003SaveOptions.MemoryOptimization.xml", options);
Shows how to manage output document's raw content.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.Writeln("Hello world!");

// Create a "WordML2003SaveOptions" object to pass to the document's "Save" method
// to modify how we save the document to the WordML save format.
WordML2003SaveOptions options = new WordML2003SaveOptions();

Assert.AreEqual(SaveFormat.WordML, options.SaveFormat);

// Set the "PrettyFormat" property to "true" to apply tab character indentation and
// newlines to make the output document's raw content easier to read.
// Set the "PrettyFormat" property to "false" to save the document's raw content in one continuous body of the text.
options.PrettyFormat = prettyFormat;

doc.Save(ArtifactsDir + "WordML2003SaveOptions.PrettyFormat.xml", options);

string fileContents = File.ReadAllText(ArtifactsDir + "WordML2003SaveOptions.PrettyFormat.xml");

if (prettyFormat)
    Assert.True(fileContents.Contains(
        "<o:DocumentProperties>\r\n\t\t" +
            "<o:Revision>1</o:Revision>\r\n\t\t" +
            "<o:TotalTime>0</o:TotalTime>\r\n\t\t" +
            "<o:Pages>1</o:Pages>\r\n\t\t" +
            "<o:Words>0</o:Words>\r\n\t\t" +
            "<o:Characters>0</o:Characters>\r\n\t\t" +
            "<o:Lines>1</o:Lines>\r\n\t\t" +
            "<o:Paragraphs>1</o:Paragraphs>\r\n\t\t" +
            "<o:CharactersWithSpaces>0</o:CharactersWithSpaces>\r\n\t\t" +
            "<o:Version>11.5606</o:Version>\r\n\t" +
        "</o:DocumentProperties>"));
else
    Assert.True(fileContents.Contains(
        "<o:DocumentProperties><o:Revision>1</o:Revision><o:TotalTime>0</o:TotalTime><o:Pages>1</o:Pages>" +
        "<o:Words>0</o:Words><o:Characters>0</o:Characters><o:Lines>1</o:Lines><o:Paragraphs>1</o:Paragraphs>" +
        "<o:CharactersWithSpaces>0</o:CharactersWithSpaces><o:Version>11.5606</o:Version></o:DocumentProperties>"));

ExpandedSee Also