MetafileRenderingOptions.EmulateRasterOperations
MetafileRenderingOptions.EmulateRasterOperations property
Gets or sets a value determining whether or not the raster operations should be emulated.
public bool EmulateRasterOperations { get; set; }
Remarks
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
, Wordize emulates the raster operations. The resulting output maybe partially rasterized and performance might be slower.
When this value is set to false
, Wordize does not emulate the raster operations. When Wordize 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
.
Examples
Shows how to configure metafile rendering.
PdfSaveOptions pdfSaveOptions = new PdfSaveOptions();
// Set the "EmulateRasterOperations" property to "false" to fall back to bitmap when
// it encounters a metafile, which will require raster operations to render in the output PDF.
pdfSaveOptions.MetafileRenderingOptions.EmulateRasterOperations = false;
// Set the "RenderingMode" property to "VectorWithFallback" to try to render every metafile using vector graphics.
pdfSaveOptions.MetafileRenderingOptions.RenderingMode = MetafileRenderingMode.VectorWithFallback;
// Set the "EmfPlusDualRenderingMode" property to "EmfPlusDualRenderingMode.Emf"
// to only render the EMF part of an EMF+ dual metafile.
pdfSaveOptions.MetafileRenderingOptions.EmfPlusDualRenderingMode = MetafileEmfPlusDualRenderingMode.Emf;
// Set the "UseEmfEmbeddedToWmf" property to "true" to render embedded EMF data
// for metafiles that we can render as vector graphics.
pdfSaveOptions.MetafileRenderingOptions.UseEmfEmbeddedToWmf = true;
// Set the "EmulateRenderingToSizeOnPage" property to "false" to emulate metafile rendering to its default size in pixels.
pdfSaveOptions.MetafileRenderingOptions.EmulateRenderingToSizeOnPage = false;
pdfSaveOptions.MetafileRenderingOptions.EmulateRenderingToSizeOnPageResolution = 50;
// Wordize uses GDI+ for raster operations emulation, when value is set to true.
pdfSaveOptions.MetafileRenderingOptions.UseGdiRasterOperationsEmulation = true;
Converter.Create()
.From(MyDir + "Simple.docx")
.To(ArtifactsDir + "FixedPageSaveOptions.MetafileRenderingOptions.pdf", pdfSaveOptions)
.Execute();
See Also
- class MetafileRenderingOptions
- namespace Wordize.Saving
- assembly Wordize