Aspose::Words::Saving::DocSaveOptions class

DocSaveOptions class

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

class DocSaveOptions : 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.
DocSaveOptions()Initializes a new instance of this class that can be used to save a document in the Doc format.
DocSaveOptions(Aspose::Words::SaveFormat)Initializes a new instance of this class that can be used to save a document in the Doc or Dot format.
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_AlwaysCompressMetafiles() constWhen false, small metafiles are not compressed for performance reason. Default value is true, all metafiles are compressed regardless of its size.
get_CustomTimeZoneInfo() const
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_Password() constGets/sets a password to encrypt document using RC4 encryption method.
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 be Doc or Dot.
get_SavePictureBullet() constWhen false, PictureBullet data is not saved to output document. Default value is true.
get_SaveRoutingSlip() constWhen false, RoutingSlip data is not saved to output document. Default value is true.
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_AlwaysCompressMetafiles(bool)Setter for Aspose::Words::Saving::DocSaveOptions::get_AlwaysCompressMetafiles.
set_CustomTimeZoneInfo(const System::SharedPtr<System::TimeZoneInfo>&)
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_Password(const System::String&)Setter for Aspose::Words::Saving::DocSaveOptions::get_Password.
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::DocSaveOptions::get_SaveFormat.
set_SavePictureBullet(bool)Setter for Aspose::Words::Saving::DocSaveOptions::get_SavePictureBullet.
set_SaveRoutingSlip(bool)Setter for Aspose::Words::Saving::DocSaveOptions::get_SaveRoutingSlip.
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 will have other options added, such as an encryption password or digital signature settings.

Examples

Shows how to set save options for older Microsoft Word formats.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);
builder->Write(u"Hello world!");

auto options = MakeObject<DocSaveOptions>(SaveFormat::Doc);

// Set a password which will protect the loading of the document by Microsoft Word or Aspose.Words.
// Note that this does not encrypt the contents of the document in any way.
options->set_Password(u"MyPassword");

// If the document contains a routing slip, we can preserve it while saving by setting this flag to true.
options->set_SaveRoutingSlip(true);

doc->Save(ArtifactsDir + u"DocSaveOptions.SaveAsDoc.doc", options);

// To be able to load the document,
// we will need to apply the password we specified in the DocSaveOptions object in a LoadOptions object.
ASSERT_THROW(doc = MakeObject<Document>(ArtifactsDir + u"DocSaveOptions.SaveAsDoc.doc"), IncorrectPasswordException);

auto loadOptions = MakeObject<LoadOptions>(u"MyPassword");
doc = MakeObject<Document>(ArtifactsDir + u"DocSaveOptions.SaveAsDoc.doc", loadOptions);

ASSERT_EQ(u"Hello world!", doc->GetText().Trim());

See Also