com.aspose.words
Class MetafileRenderingOptions

java.lang.Object
    extended by com.aspose.words.MetafileRenderingOptions

public class MetafileRenderingOptions 
extends java.lang.Object

Allows to specify additional metafile rendering options.

To learn more, visit the Handling Windows Metafiles documentation article.


Constructor Summary
MetafileRenderingOptions()
          
 
Property Getters/Setters Summary
intgetEmfPlusDualRenderingMode()
voidsetEmfPlusDualRenderingMode(int value)
           Gets or sets a value determining how EMF+ Dual metafiles should be rendered. The value of the property is EmfPlusDualRenderingMode integer constant.
booleangetEmulateRasterOperations()
voidsetEmulateRasterOperations(boolean value)
           Gets or sets a value determining whether or not the raster operations should be emulated.
intgetRenderingMode()
voidsetRenderingMode(int value)
           Gets or sets a value determining how metafile images should be rendered. The value of the property is MetafileRenderingMode integer constant.
booleangetScaleWmfFontsToMetafileSize()
voidsetScaleWmfFontsToMetafileSize(boolean value)
           Gets or sets a value determining whether or not to scale fonts in WMF metafile according to metafile size on the page.
booleangetUseEmfEmbeddedToWmf()
voidsetUseEmfEmbeddedToWmf(boolean value)
           Gets or sets a value determining how WMF metafiles with embedded EMF metafiles should be rendered.
booleangetUseGdiRasterOperationsEmulation()
voidsetUseGdiRasterOperationsEmulation(boolean value)
           Gets or sets a value determining whether or not to use the GDI+ for raster operations emulation.
 

Constructor Detail

MetafileRenderingOptions

public MetafileRenderingOptions()

Property Getters/Setters Detail

getEmfPlusDualRenderingMode/setEmfPlusDualRenderingMode

public int getEmfPlusDualRenderingMode() / public void setEmfPlusDualRenderingMode(int value)
Gets or sets a value determining how EMF+ Dual metafiles should be rendered. The value of the property is EmfPlusDualRenderingMode integer constant.

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 EmfPlusDualRenderingMode.EMF_PLUS_WITH_FALLBACK.


getEmulateRasterOperations/setEmulateRasterOperations

public boolean getEmulateRasterOperations() / public void setEmulateRasterOperations(boolean value)
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.


getRenderingMode/setRenderingMode

public int getRenderingMode() / public void setRenderingMode(int value)
Gets or sets a value determining how metafile images should be rendered. The value of the property is MetafileRenderingMode integer constant.

The default value depends on the save format. For images it is MetafileRenderingMode.BITMAP. For other formats it is MetafileRenderingMode.VECTOR_WITH_FALLBACK.


getScaleWmfFontsToMetafileSize/setScaleWmfFontsToMetafileSize

public boolean getScaleWmfFontsToMetafileSize() / public void setScaleWmfFontsToMetafileSize(boolean value)
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.


getUseEmfEmbeddedToWmf/setUseEmfEmbeddedToWmf

public boolean getUseEmfEmbeddedToWmf() / public void setUseEmfEmbeddedToWmf(boolean value)
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.


getUseGdiRasterOperationsEmulation/setUseGdiRasterOperationsEmulation

public boolean getUseGdiRasterOperationsEmulation() / public void setUseGdiRasterOperationsEmulation(boolean value)
Gets or sets a value determining whether or not to use the GDI+ for raster operations emulation.

Windows GDI+ library could be used to emulate raster operations. It provides support for all raster operation comparing to Aspose.Words own emulation but performance may be slower in some cases.

When this value is set to true, Aspose.Words uses GDI+ for raster operations emulation.

When this value is set to false, Aspose.Words uses its own implementation of raster operations emulation.

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

The default value is false.

Example:

Shows how to set the rendering mode when saving documents with Windows Metafile images to other image formats.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

builder.insertImage(getImageDir() + "Windows MetaFile.wmf");

// When we save the document as an image, we can pass a SaveOptions object to
// determine how the saving operation will process Windows Metafiles in the document.
// If we set the "RenderingMode" property to "MetafileRenderingMode.Vector",
// or "MetafileRenderingMode.VectorWithFallback", we will render all metafiles as vector graphics.
// If we set the "RenderingMode" property to "MetafileRenderingMode.Bitmap", we will render all metafiles as bitmaps.
ImageSaveOptions options = new ImageSaveOptions(SaveFormat.PNG);
options.getMetafileRenderingOptions().setRenderingMode(metafileRenderingMode);
// Aspose.Words uses GDI+ for raster operations emulation, when value is set to true.
options.getMetafileRenderingOptions().setUseGdiRasterOperationsEmulation(true);

doc.save(getArtifactsDir() + "ImageSaveOptions.WindowsMetaFile.png", options);

See Also:
          Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
          Aspose.Words Support Forum - our preferred method of support.