Aspose::Words::Saving::TxtSaveOptions class

TxtSaveOptions class

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

class TxtSaveOptions : public Aspose::Words::Saving::TxtSaveOptionsBase

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_AddBidiMarks() constSpecifies whether to add bi-directional marks before each BiDi run when exporting in plain text format. The default value is false.
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_Encoding() constSpecifies the encoding to use when exporting in text formats. Default value is Encoding.UTF8.
get_ExportGeneratorName() constWhen true, causes the name and version of Aspose.Words to be embedded into produced files. Default value is true.
get_ExportHeadersFootersMode() constSpecifies the way headers and footers are exported to the text formats. Default value is PrimaryOnly.
get_ForcePageBreaks() constAllows to specify whether the page breaks should be preserved during export. The default value is false.
get_ImlRenderingMode() constGets or sets a value determining how ink (InkML) objects are rendered.
get_ListIndentation() constGets a TxtListIndentation object that specifies how many and which character to use for indentation of list levels. By default it is zero count of character ‘\0’, that means no indentation.
get_MaxCharactersPerLine() constGets or sets an integer value that specifies the maximum number of characters per one line. The default value is 0, that means no limit.
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_ParagraphBreak() constSpecifies the string to use as a paragraph break when exporting in text formats.
get_PreserveTableLayout() constSpecifies whether the program should attempt to preserve layout of tables when saving in the plain text format. The default value 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 Text.
get_SimplifyListLabels() constSpecifies whether the program should simplify list labels in case of complex label formatting not being adequately represented by plain text. If set to true, numbered list labels are written in simple numeric format and itemized list labels as simple ASCII characters. The default value is false.
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_AddBidiMarks(bool)Setter for Aspose::Words::Saving::TxtSaveOptions::get_AddBidiMarks.
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_Encoding(const System::SharedPtr<System::Text::Encoding>&)Specifies the encoding to use when exporting in text formats. Default value is Encoding.UTF8.
set_ExportGeneratorName(bool)Setter for Aspose::Words::Saving::SaveOptions::get_ExportGeneratorName.
set_ExportHeadersFootersMode(Aspose::Words::Saving::TxtExportHeadersFootersMode)Setter for Aspose::Words::Saving::TxtSaveOptionsBase::get_ExportHeadersFootersMode.
set_ForcePageBreaks(bool)Setter for Aspose::Words::Saving::TxtSaveOptionsBase::get_ForcePageBreaks.
set_ImlRenderingMode(Aspose::Words::Saving::ImlRenderingMode)Setter for Aspose::Words::Saving::SaveOptions::get_ImlRenderingMode.
set_MaxCharactersPerLine(int32_t)Setter for Aspose::Words::Saving::TxtSaveOptions::get_MaxCharactersPerLine.
set_MemoryOptimization(bool)Setter for Aspose::Words::Saving::SaveOptions::get_MemoryOptimization.
set_ParagraphBreak(const System::String&)Setter for Aspose::Words::Saving::TxtSaveOptionsBase::get_ParagraphBreak.
set_PreserveTableLayout(bool)Setter for Aspose::Words::Saving::TxtSaveOptions::get_PreserveTableLayout.
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::TxtSaveOptions::get_SaveFormat.
set_SimplifyListLabels(bool)Setter for Aspose::Words::Saving::TxtSaveOptions::get_SimplifyListLabels.
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.
TxtSaveOptions()
TxtSaveOptionsBase()
static Type()

Examples

Shows how to save a .txt document with a custom paragraph break.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);

builder->Writeln(u"Paragraph 1.");
builder->Writeln(u"Paragraph 2.");
builder->Write(u"Paragraph 3.");

// Create a "TxtSaveOptions" object, which we can pass to the document's "Save" method
// to modify how we save the document to plaintext.
auto txtSaveOptions = MakeObject<TxtSaveOptions>();

ASSERT_EQ(SaveFormat::Text, txtSaveOptions->get_SaveFormat());

// Set the "ParagraphBreak" to a custom value that we wish to put at the end of every paragraph.
txtSaveOptions->set_ParagraphBreak(u" End of paragraph.\n\n\t");

doc->Save(ArtifactsDir + u"TxtSaveOptions.ParagraphBreak.txt", txtSaveOptions);

String docText = System::IO::File::ReadAllText(ArtifactsDir + u"TxtSaveOptions.ParagraphBreak.txt");

ASSERT_EQ(String(u"Paragraph 1. End of paragraph.\n\n\t") + u"Paragraph 2. End of paragraph.\n\n\t" + u"Paragraph 3. End of paragraph.\n\n\t", docText);

See Also