Aspose::Words::Saving::WordML2003SaveOptions class

WordML2003SaveOptions class

Can be used to specify additional options when saving a document into the WordML format. To learn more, visit the Specify Save Options documentation article.

class WordML2003SaveOptions : public Aspose::Words::Saving::SaveOptions

Methods

MethodDescription
static CreateSaveOptions(Aspose::Words::SaveFormat)Creates a save options object of a class suitable for the specified save format.
static CreateSaveOptions(const System::String&)Creates a save options object of a class suitable for the file extension specified in the given file name.
get_AllowEmbeddingPostScriptFonts() constGets 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.
get_CustomTimeZoneInfo() constGets or sets custom local time zone used for date/time fields.
get_DefaultTemplate() constGets or sets path to default template (including filename). Default value for this property is empty string.
get_Dml3DEffectsRenderingMode() constGets a value determining how 3D effects are rendered.
virtual get_DmlEffectsRenderingMode()Gets or sets a value determining how DrawingML effects are rendered.
get_DmlRenderingMode() constGets or sets a value determining how DrawingML shapes are rendered.
get_ExportGeneratorName() constWhen true, causes the name and version of Aspose.Words to be embedded into produced files. Default value is true.
get_ImlRenderingMode() constGets or sets a value determining how ink (InkML) objects are rendered.
get_MemoryOptimization() constGets or sets value determining if memory optimization should be performed before saving the document. Default value for this property is false.
get_PrettyFormat() constWhen true, pretty formats output where applicable. Default value is false.
get_ProgressCallback() constCalled during saving a document and accepts data about saving progress.
get_SaveFormat() overrideSpecifies the format in which the document will be saved if this save options object is used. Can only be WordML.
get_TempFolder() constSpecifies 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.
get_UpdateCreatedTimeProperty() constGets a value determining whether the CreatedTime property is updated before saving. Default value is false;.
get_UpdateFields() constGets 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.
get_UpdateLastPrintedProperty() constGets or sets a value determining whether the LastPrinted property is updated before saving.
get_UpdateLastSavedTimeProperty() constGets or sets a value determining whether the LastSavedTime property is updated before saving.
get_UseAntiAliasing() constGets or sets a value determining whether or not to use anti-aliasing for rendering.
get_UseHighQualityRendering() constGets or sets a value determining whether or not to use high quality (i.e. slow) rendering algorithms.
GetType() const override
Is(const System::TypeInfo&) const override
set_AllowEmbeddingPostScriptFonts(bool)Setter for Aspose::Words::Saving::SaveOptions::get_AllowEmbeddingPostScriptFonts.
set_CustomTimeZoneInfo(const System::SharedPtr<System::TimeZoneInfo>&)Setter for Aspose::Words::Saving::SaveOptions::get_CustomTimeZoneInfo.
set_DefaultTemplate(const System::String&)Setter for Aspose::Words::Saving::SaveOptions::get_DefaultTemplate.
set_Dml3DEffectsRenderingMode(Aspose::Words::Saving::Dml3DEffectsRenderingMode)Sets a value determining how 3D effects are rendered.
virtual set_DmlEffectsRenderingMode(Aspose::Words::Saving::DmlEffectsRenderingMode)Setter for Aspose::Words::Saving::SaveOptions::get_DmlEffectsRenderingMode.
set_DmlRenderingMode(Aspose::Words::Saving::DmlRenderingMode)Setter for Aspose::Words::Saving::SaveOptions::get_DmlRenderingMode.
set_ExportGeneratorName(bool)Setter for Aspose::Words::Saving::SaveOptions::get_ExportGeneratorName.
set_ImlRenderingMode(Aspose::Words::Saving::ImlRenderingMode)Setter for Aspose::Words::Saving::SaveOptions::get_ImlRenderingMode.
set_MemoryOptimization(bool)Setter for Aspose::Words::Saving::SaveOptions::get_MemoryOptimization.
set_PrettyFormat(bool)Setter for Aspose::Words::Saving::SaveOptions::get_PrettyFormat.
set_ProgressCallback(const System::SharedPtr<Aspose::Words::Saving::IDocumentSavingCallback>&)Setter for Aspose::Words::Saving::SaveOptions::get_ProgressCallback.
set_SaveFormat(Aspose::Words::SaveFormat) overrideSetter for Aspose::Words::Saving::WordML2003SaveOptions::get_SaveFormat.
set_TempFolder(const System::String&)Setter for Aspose::Words::Saving::SaveOptions::get_TempFolder.
set_UpdateCreatedTimeProperty(bool)Sets a value determining whether the CreatedTime property is updated before saving. Default value is false;.
set_UpdateFields(bool)Setter for Aspose::Words::Saving::SaveOptions::get_UpdateFields.
set_UpdateLastPrintedProperty(bool)Setter for Aspose::Words::Saving::SaveOptions::get_UpdateLastPrintedProperty.
set_UpdateLastSavedTimeProperty(bool)Setter for Aspose::Words::Saving::SaveOptions::get_UpdateLastSavedTimeProperty.
set_UseAntiAliasing(bool)Setter for Aspose::Words::Saving::SaveOptions::get_UseAntiAliasing.
set_UseHighQualityRendering(bool)Setter for Aspose::Words::Saving::SaveOptions::get_UseHighQualityRendering.
static Type()

Remarks

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

Examples

Shows how to manage output document’s raw content.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"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.
auto options = MakeObject<WordML2003SaveOptions>();

ASSERT_EQ(SaveFormat::WordML, options->get_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->set_PrettyFormat(prettyFormat);

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

String fileContents = System::IO::File::ReadAllText(ArtifactsDir + u"WordML2003SaveOptions.PrettyFormat.xml");

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

Shows how to manage memory optimization.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Writeln(u"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.
auto options = MakeObject<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->set_MemoryOptimization(memoryOptimization);

doc->Save(ArtifactsDir + u"WordML2003SaveOptions.MemoryOptimization.xml", options);

See Also