search/mag_sel search/close
Aspose::Words::Saving::WordML2003SaveOptions Class Reference

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

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);

#include <Aspose.Words.Cpp/Saving/WordML2003SaveOptions.h>

+ Inheritance diagram for Aspose::Words::Saving::WordML2003SaveOptions:

Public Member Functions

SaveFormat get_SaveFormat () override
 Specifies the format in which the document will be saved if this save options object is used. Can only be WordML. More...
 
virtual const TypeInfoGetType () const override
 
virtual bool Is (const TypeInfo &target) const override
 
void set_SaveFormat (SaveFormat value) override
 Setter for get_SaveFormat. More...
 
- Public Member Functions inherited from SaveOptions
bool get_AllowEmbeddingPostScriptFonts () const
 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. More...
 
SharedPtr< TimeZoneInfoget_CustomTimeZoneInfo () const
 
String get_DefaultTemplate () const
 Gets or sets path to default template (including filename). Default value for this property is empty string. More...
 
Dml3DEffectsRenderingMode get_Dml3DEffectsRenderingMode () const
 Gets a value determining how 3D effects are rendered. More...
 
virtual DmlEffectsRenderingMode get_DmlEffectsRenderingMode ()
 Gets or sets a value determining how DrawingML effects are rendered. More...
 
DmlRenderingMode get_DmlRenderingMode () const
 Gets or sets a value determining how DrawingML shapes are rendered. More...
 
ImlRenderingMode get_ImlRenderingMode () const
 Gets or sets a value determining how ink (InkML) objects are rendered. More...
 
bool get_MemoryOptimization () const
 Gets or sets value determining if memory optimization should be performed before saving the document. Default value for this property is false. More...
 
bool get_PrettyFormat () const
 When true, pretty formats output where applicable. Default value is false. More...
 
String get_TempFolder () const
 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. More...
 
bool get_UpdateCreatedTimeProperty () const
 Gets a value determining whether the CreatedTime property is updated before saving. Default value is false;. More...
 
bool get_UpdateFields () const
 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. More...
 
bool get_UpdateLastPrintedProperty () const
 Gets or sets a value determining whether the LastPrinted property is updated before saving. More...
 
bool get_UpdateLastSavedTimeProperty () const
 Gets or sets a value determining whether the LastSavedTime property is updated before saving. More...
 
bool get_UpdateSdtContent () const
 Gets or sets value determining whether content of StructuredDocumentTag is updated before saving. More...
 
bool get_UseAntiAliasing () const
 Gets or sets a value determining whether or not to use anti-aliasing for rendering. More...
 
bool get_UseHighQualityRendering () const
 Gets or sets a value determining whether or not to use high quality (i.e. slow) rendering algorithms. More...
 
void set_AllowEmbeddingPostScriptFonts (bool value)
 Setter for get_AllowEmbeddingPostScriptFonts. More...
 
void set_CustomTimeZoneInfo (SharedPtr< TimeZoneInfo > value)
 
void set_DefaultTemplate (String value)
 Setter for get_DefaultTemplate. More...
 
void set_Dml3DEffectsRenderingMode (Dml3DEffectsRenderingMode value)
 Sets a value determining how 3D effects are rendered. More...
 
virtual void set_DmlEffectsRenderingMode (DmlEffectsRenderingMode value)
 Setter for get_DmlEffectsRenderingMode. More...
 
void set_DmlRenderingMode (DmlRenderingMode value)
 Setter for get_DmlRenderingMode. More...
 
void set_ImlRenderingMode (ImlRenderingMode value)
 Setter for get_ImlRenderingMode. More...
 
void set_MemoryOptimization (bool value)
 Setter for get_MemoryOptimization. More...
 
void set_PrettyFormat (bool value)
 Setter for get_PrettyFormat. More...
 
void set_TempFolder (String value)
 Setter for get_TempFolder. More...
 
void set_UpdateCreatedTimeProperty (bool value)
 Sets a value determining whether the CreatedTime property is updated before saving. Default value is false;. More...
 
void set_UpdateFields (bool value)
 Setter for get_UpdateFields. More...
 
void set_UpdateLastPrintedProperty (bool value)
 Setter for get_UpdateLastPrintedProperty. More...
 
void set_UpdateLastSavedTimeProperty (bool value)
 Setter for get_UpdateLastSavedTimeProperty. More...
 
void set_UpdateSdtContent (bool value)
 Setter for get_UpdateSdtContent. More...
 
void set_UseAntiAliasing (bool value)
 Setter for get_UseAntiAliasing. More...
 
void set_UseHighQualityRendering (bool value)
 Setter for get_UseHighQualityRendering. More...
 

Static Public Member Functions

static const TypeInfoType ()
 
- Static Public Member Functions inherited from SaveOptions
static SharedPtr< SaveOptionsCreateSaveOptions (SaveFormat saveFormat)
 Creates a save options object of a class suitable for the specified save format. More...
 
static SharedPtr< SaveOptionsCreateSaveOptions (String fileName)
 Creates a save options object of a class suitable for the file extension specified in the given file name. More...
 
static const TypeInfoType ()
 

Member Function Documentation

◆ get_SaveFormat()

Aspose::Words::SaveFormat Aspose::Words::Saving::WordML2003SaveOptions::get_SaveFormat ( )
overridevirtual

Specifies the format in which the document will be saved if this save options object is used. Can only be WordML.

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>"));
}

Implements Aspose::Words::Saving::SaveOptions.

◆ GetType()

virtual const System::TypeInfo& Aspose::Words::Saving::WordML2003SaveOptions::GetType ( ) const
overridevirtual

◆ Is()

virtual bool Aspose::Words::Saving::WordML2003SaveOptions::Is ( const System::TypeInfo target) const
overridevirtual

◆ set_SaveFormat()

void Aspose::Words::Saving::WordML2003SaveOptions::set_SaveFormat ( Aspose::Words::SaveFormat  value)
overridevirtual

◆ Type()

static const System::TypeInfo& Aspose::Words::Saving::WordML2003SaveOptions::Type ( )
static