Aspose::Words::Saving::RtfSaveOptions Class Reference

Detailed Description

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

Examples

Shows how to save a document to .rtf with custom options.

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
// Configure a RtfSaveOptions instance to make our output document more suitable for older devices
auto options = MakeObject<RtfSaveOptions>();
options->set_SaveFormat(Aspose::Words::SaveFormat::Rtf);
options->set_ExportCompactSize(true);
options->set_ExportImagesForOldReaders(doExportImagesForOldReaders);
doc->Save(ArtifactsDir + u"RtfSaveOptions.ExportImages.rtf", options);

#include <Aspose.Words.Cpp/Model/Saving/RtfSaveOptions.h>

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

Public Member Functions

 RtfSaveOptions ()
 
bool get_ExportCompactSize () const
 Allows to make output RTF documents smaller in size, but if they contain RTL (right-to-left) text, it will not be displayed correctly. Default value is false. More...
 
bool get_ExportImagesForOldReaders () const
 Specifies whether the keywords for "old readers" are written to RTF or not. This can significantly affect the size of the RTF document. Default value is true. More...
 
SaveFormat get_SaveFormat () override
 Specifies the format in which the document will be saved if this save options object is used. Can only be Rtf. More...
 
bool get_SaveImagesAsWmf () const
 When true all images will be saved as WMF. More...
 
virtual const TypeInfoGetType () const override
 
virtual bool Is (const TypeInfo &target) const override
 
void set_ExportCompactSize (bool value)
 Setter for get_ExportCompactSize. More...
 
void set_ExportImagesForOldReaders (bool value)
 Setter for get_ExportImagesForOldReaders. More...
 
void set_SaveFormat (SaveFormat value) override
 Setter for get_SaveFormat. More...
 
void set_SaveImagesAsWmf (bool value)
 Setter for get_SaveImagesAsWmf. More...
 
- Public Member Functions inherited from SaveOptions
String get_DefaultTemplate () const
 Gets or sets path to default template (including filename). Default value for this property is empty string (Empty). 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...
 
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_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_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_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_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...
 
- Public Member Functions inherited from Object
ASPOSECPP_SHARED_API Object ()
 
ASPOSECPP_SHARED_API Object (Object const &x)
 
virtual ASPOSECPP_SHARED_API ~Object ()
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 
Detail::SmartPtrCounter * GetCounter ()
 
virtual ASPOSECPP_SHARED_API int GetHashCode () const
 
ASPOSECPP_SHARED_API void Lock ()
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 
Objectoperator= (Object const &x)
 
bool ReferenceEquals (String const &str, std::nullptr_t)
 
bool ReferenceEquals (String const &str1, String const &str2)
 
int RemovedSharedRefs (int count)
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (unsigned int argument)
 
int SharedCount () const
 
ObjectSharedRefAdded ()
 
int SharedRefRemovedSafe ()
 
virtual ASPOSECPP_SHARED_API String ToString () const
 
ASPOSECPP_SHARED_API void Unlock ()
 
Detail::SmartPtrCounter * WeakRefAdded ()
 
void WeakRefRemoved ()
 

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 ()
 
- Static Public Member Functions inherited from Object
bool Equals (double const &objA, double const &objB)
 
bool Equals (float const &objA, float const &objB)
 
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 
static const TypeInfoType ()
 

Additional Inherited Members

- Public Types inherited from Object
typedef SmartPtr< Objectptr
 
typedef System::Details::SharedMembersType shared_members_type
 

Constructor & Destructor Documentation

◆ RtfSaveOptions()

Aspose::Words::Saving::RtfSaveOptions::RtfSaveOptions ( )

Member Function Documentation

◆ get_ExportCompactSize()

bool Aspose::Words::Saving::RtfSaveOptions::get_ExportCompactSize ( ) const

Allows to make output RTF documents smaller in size, but if they contain RTL (right-to-left) text, it will not be displayed correctly. Default value is false.

If the document that you want to convert to RTF using Aspose.Words does not contain right-to-left text in languages like Arabic, then you can set this option to true to reduce the size of the resulting RTF.

Examples

Shows how to save a document to .rtf with custom options.

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
// Configure a RtfSaveOptions instance to make our output document more suitable for older devices
auto options = MakeObject<RtfSaveOptions>();
options->set_SaveFormat(Aspose::Words::SaveFormat::Rtf);
options->set_ExportCompactSize(true);
options->set_ExportImagesForOldReaders(doExportImagesForOldReaders);
doc->Save(ArtifactsDir + u"RtfSaveOptions.ExportImages.rtf", options);

◆ get_ExportImagesForOldReaders()

bool Aspose::Words::Saving::RtfSaveOptions::get_ExportImagesForOldReaders ( ) const

Specifies whether the keywords for "old readers" are written to RTF or not. This can significantly affect the size of the RTF document. Default value is true.

"Old readers" are pre-Microsoft Word 97 applications and also WordPad. When this option is true Aspose.Words writes additional RTF keywords. These keywords allow the document to be displayed correctly when opened in an "old reader" application, but can significantly increase the size of the document.

If you set this option to false, then only images in WMF, EMF and BMP formats will be displayed in "old readers".

Examples

Shows how to save a document to .rtf with custom options.

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
// Configure a RtfSaveOptions instance to make our output document more suitable for older devices
auto options = MakeObject<RtfSaveOptions>();
options->set_SaveFormat(Aspose::Words::SaveFormat::Rtf);
options->set_ExportCompactSize(true);
options->set_ExportImagesForOldReaders(doExportImagesForOldReaders);
doc->Save(ArtifactsDir + u"RtfSaveOptions.ExportImages.rtf", options);

◆ get_SaveFormat()

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

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

Examples

Shows how to save a document to .rtf with custom options.

auto doc = MakeObject<Document>(MyDir + u"Rendering.docx");
// Configure a RtfSaveOptions instance to make our output document more suitable for older devices
auto options = MakeObject<RtfSaveOptions>();
options->set_SaveFormat(Aspose::Words::SaveFormat::Rtf);
options->set_ExportCompactSize(true);
options->set_ExportImagesForOldReaders(doExportImagesForOldReaders);
doc->Save(ArtifactsDir + u"RtfSaveOptions.ExportImages.rtf", options);

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

◆ get_SaveImagesAsWmf()

bool Aspose::Words::Saving::RtfSaveOptions::get_SaveImagesAsWmf ( ) const

When true all images will be saved as WMF.

Examples

Shows how to save all images as Wmf when saving to the Rtf document.

// Open a document that contains images in the jpeg format
auto doc = MakeObject<Document>(MyDir + u"Images.docx");
SharedPtr<NodeCollection> shapes = doc->GetChildNodes(Aspose::Words::NodeType::Shape, true);
auto shapeWithJpg = System::DynamicCast<Aspose::Words::Drawing::Shape>(shapes->idx_get(0));
ASSERT_EQ(Aspose::Words::Drawing::ImageType::Jpeg, shapeWithJpg->get_ImageData()->get_ImageType());
auto rtfSaveOptions = MakeObject<RtfSaveOptions>();
rtfSaveOptions->set_SaveImagesAsWmf(true);
doc->Save(ArtifactsDir + u"RtfSaveOptions.SaveImagesAsWmf.rtf", rtfSaveOptions);

◆ GetType()

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

◆ Is()

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

◆ set_ExportCompactSize()

void Aspose::Words::Saving::RtfSaveOptions::set_ExportCompactSize ( bool  value)

◆ set_ExportImagesForOldReaders()

void Aspose::Words::Saving::RtfSaveOptions::set_ExportImagesForOldReaders ( bool  value)

◆ set_SaveFormat()

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

◆ set_SaveImagesAsWmf()

void Aspose::Words::Saving::RtfSaveOptions::set_SaveImagesAsWmf ( bool  value)

◆ Type()

static const System::TypeInfo& Aspose::Words::Saving::RtfSaveOptions::Type ( )
static
@ Shape
A drawing object, such as an OfficeArt shape, image or an OLE object. A Shape node can contain Paragr...
@ Rtf
Saves the document in the RTF format. All characters above 7-bits are escaped as hexadecimal or Unico...
@ Jpeg
JPEG JFIF.