Aspose::Words::Saving::MetafileRenderingOptions Class Reference

Detailed Description

Allows to specify additional metafile rendering options.

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

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

Public Member Functions

 MetafileRenderingOptions ()
 
EmfPlusDualRenderingMode get_EmfPlusDualRenderingMode () const
 Gets or sets a value determining how EMF+ Dual metafiles should be rendered. More...
 
bool get_EmulateRasterOperations () const
 Gets or sets a value determining whether or not the raster operations should be emulated. More...
 
MetafileRenderingMode get_RenderingMode () const
 Gets or sets a value determining how metafile images should be rendered. More...
 
bool get_ScaleWmfFontsToMetafileSize () const
 Gets or sets a value determining whether or not to scale fonts in WMF metafile according to metafile size on the page. More...
 
bool get_UseEmfEmbeddedToWmf () const
 Gets or sets a value determining how WMF metafiles with embedded EMF metafiles should be rendered. More...
 
virtual const TypeInfoGetType () const override
 
virtual bool Is (const TypeInfo &target) const override
 
void set_EmfPlusDualRenderingMode (EmfPlusDualRenderingMode value)
 Setter for get_EmfPlusDualRenderingMode. More...
 
void set_EmulateRasterOperations (bool value)
 Setter for get_EmulateRasterOperations. More...
 
void set_RenderingMode (MetafileRenderingMode value)
 Setter for get_RenderingMode. More...
 
void set_ScaleWmfFontsToMetafileSize (bool value)
 Setter for get_ScaleWmfFontsToMetafileSize. More...
 
void set_UseEmfEmbeddedToWmf (bool value)
 Setter for get_UseEmfEmbeddedToWmf. 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 int32_t 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 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

◆ MetafileRenderingOptions()

Aspose::Words::Saving::MetafileRenderingOptions::MetafileRenderingOptions ( )

Member Function Documentation

◆ get_EmfPlusDualRenderingMode()

Aspose::Words::Saving::EmfPlusDualRenderingMode Aspose::Words::Saving::MetafileRenderingOptions::get_EmfPlusDualRenderingMode ( ) const

Gets or sets a value determining how EMF+ Dual metafiles should be rendered.

EMF+ Dual metafiles contains both EMF+ and EMF parts. MS Word and GDI+ always renders EMF+ part. Aspose.Words currently doesn't fully supports all EMF+ records and in some cases rendering result of EMF part looks better then rendering result of EMF+ part.

This option is used only when metafile is rendered as vector graphics. When metafile is rendered to bitmap, EMF+ part is always used.

The default value is EmfPlusWithFallback.

Examples

Shows how to adjust EMF (Enhanced Windows Metafile) rendering options when saving to PDF.

auto doc = MakeObject<Document>(MyDir + u"EMF.docx");
auto saveOptions = MakeObject<PdfSaveOptions>();
saveOptions->get_MetafileRenderingOptions()->set_EmfPlusDualRenderingMode(renderingMode);
saveOptions->get_MetafileRenderingOptions()->set_UseEmfEmbeddedToWmf(true);
doc->Save(ArtifactsDir + u"PdfSaveOptions.RenderMetafile.pdf", saveOptions);

◆ get_EmulateRasterOperations()

bool Aspose::Words::Saving::MetafileRenderingOptions::get_EmulateRasterOperations ( ) const

Gets or sets a value determining whether or not the raster operations should be emulated.

Specific raster operations could be used in metafiles. They can not be rendered directly to vector graphics. Emulating raster operations requires partial rasterization of the resulting vector graphics which may affect the metafile rendering performance.

When this value is set to true, Aspose.Words emulates the raster operations. The resulting output maybe partially rasterized and performance might be slower.

When this value is set to false, Aspose.Words does not emulate the raster operations. When Aspose.Words encounters a raster operation in a metafile it fallbacks to rendering the metafile into a bitmap by using the operating system.

This option is used only when metafile is rendered as vector graphics.

The default value is true.

◆ get_RenderingMode()

Aspose::Words::Saving::MetafileRenderingMode Aspose::Words::Saving::MetafileRenderingOptions::get_RenderingMode ( ) const

Gets or sets a value determining how metafile images should be rendered.

The default value depends on the save format. For images it is Bitmap. For other formats it is VectorWithFallback.

◆ get_ScaleWmfFontsToMetafileSize()

bool Aspose::Words::Saving::MetafileRenderingOptions::get_ScaleWmfFontsToMetafileSize ( ) const

Gets or sets a value determining whether or not to scale fonts in WMF metafile according to metafile size on the page.

When WMF metafiles are displayed in MS Word, fonts may be scaled according to actual metafile size on the page.

When this value is set to true, Aspose.Words emulates font scaling according to metafile size on the page.

When this value is set to false, Aspose.Words displays the fonts as metafile is rendered to its default size.

This option is used only when metafile is rendered as vector graphics.

The default value is true.

Examples

Shows how to WMF fonts scaling according to metafile size on the page.

auto doc = MakeObject<Document>(MyDir + u"WMF with text.docx");
// There is a several options for this:
// 'True' - Aspose.Words emulates font scaling according to metafile size on the page
// 'False' - Aspose.Words displays the fonts as metafile is rendered to its default size
// Use 'False' option is used only when metafile is rendered as vector graphics
auto saveOptions = MakeObject<PdfSaveOptions>();
saveOptions->get_MetafileRenderingOptions()->set_ScaleWmfFontsToMetafileSize(doScaleWmfFonts);
doc->Save(ArtifactsDir + u"PdfSaveOptions.FontsScaledToMetafileSize.pdf", saveOptions);

◆ get_UseEmfEmbeddedToWmf()

bool Aspose::Words::Saving::MetafileRenderingOptions::get_UseEmfEmbeddedToWmf ( ) const

Gets or sets a value determining how WMF metafiles with embedded EMF metafiles should be rendered.

WMF metafiles could contain embedded EMF data. MS Word in most cases uses embedded EMF data. GDI+ always uses WMF data.

When this value is set to true, Aspose.Words uses embedded EMF data when rendering.

When this value is set to false, Aspose.Words uses WMF data when rendering.

This option is used only when metafile is rendered as vector graphics. When metafile is rendered to bitmap, WMF data is always used.

The default value is true.

Examples

Shows how to adjust EMF (Enhanced Windows Metafile) rendering options when saving to PDF.

auto doc = MakeObject<Document>(MyDir + u"EMF.docx");
auto saveOptions = MakeObject<PdfSaveOptions>();
saveOptions->get_MetafileRenderingOptions()->set_EmfPlusDualRenderingMode(renderingMode);
saveOptions->get_MetafileRenderingOptions()->set_UseEmfEmbeddedToWmf(true);
doc->Save(ArtifactsDir + u"PdfSaveOptions.RenderMetafile.pdf", saveOptions);

◆ GetType()

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

Reimplemented from System::Object.

◆ Is()

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

Reimplemented from System::Object.

◆ set_EmfPlusDualRenderingMode()

void Aspose::Words::Saving::MetafileRenderingOptions::set_EmfPlusDualRenderingMode ( Aspose::Words::Saving::EmfPlusDualRenderingMode  value)

◆ set_EmulateRasterOperations()

void Aspose::Words::Saving::MetafileRenderingOptions::set_EmulateRasterOperations ( bool  value)

◆ set_RenderingMode()

void Aspose::Words::Saving::MetafileRenderingOptions::set_RenderingMode ( Aspose::Words::Saving::MetafileRenderingMode  value)

◆ set_ScaleWmfFontsToMetafileSize()

void Aspose::Words::Saving::MetafileRenderingOptions::set_ScaleWmfFontsToMetafileSize ( bool  value)

◆ set_UseEmfEmbeddedToWmf()

void Aspose::Words::Saving::MetafileRenderingOptions::set_UseEmfEmbeddedToWmf ( bool  value)

◆ Type()

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