Enum DmlRenderingMode
Namespace: Aspose.Words.Saving
Assembly: Aspose.Words.dll (25.12.0)
Specifies how DrawingML shapes are rendered to fixed page formats.
public enum DmlRenderingModeFields
DrawingML = 1
Aspose.Words ignores fall-back shape of DrawingML and renders DrawingML itself. This is the default mode.
Fallback = 0
If fall-back shape is available for DrawingML, Aspose.Words renders fall-back shape instead of the DrawingML.
Please note that after saving a document to a fixed page format with fall-back DML rendering mode, DML shapes in the AW document model are permanently replaced with their fall-back counterparts. As a result, saving the same document again will always use fall-back shapes, even if Aspose.Words.Saving.DmlRenderingMode is set to Aspose.Words.Saving.DmlRenderingMode.DrawingML.
Examples
Shows how to render fallback shapes when saving to PDF.
Document doc = new Document(MyDir + "DrawingML shape fallbacks.docx");
// Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
// to modify how that method converts the document to .PDF.
PdfSaveOptions options = new PdfSaveOptions();
// Set the "DmlRenderingMode" property to "DmlRenderingMode.Fallback"
// to substitute DML shapes with their fallback shapes.
// Set the "DmlRenderingMode" property to "DmlRenderingMode.DrawingML"
// to render the DML shapes themselves.
options.DmlRenderingMode = dmlRenderingMode;
doc.Save(ArtifactsDir + "PdfSaveOptions.DrawingMLFallback.pdf", options);Shows how to configure the rendering quality of DrawingML effects in a document as we save it to PDF.
Document doc = new Document(MyDir + "DrawingML shape effects.docx");
// Create a "PdfSaveOptions" object that we can pass to the document's "Save" method
// to modify how that method converts the document to .PDF.
PdfSaveOptions options = new PdfSaveOptions();
// Set the "DmlEffectsRenderingMode" property to "DmlEffectsRenderingMode.None" to discard all DrawingML effects.
// Set the "DmlEffectsRenderingMode" property to "DmlEffectsRenderingMode.Simplified"
// to render a simplified version of DrawingML effects.
// Set the "DmlEffectsRenderingMode" property to "DmlEffectsRenderingMode.Fine" to
// render DrawingML effects with more accuracy and also with more processing cost.
options.DmlEffectsRenderingMode = effectsRenderingMode;
Assert.That(options.DmlRenderingMode, Is.EqualTo(DmlRenderingMode.DrawingML));
doc.Save(ArtifactsDir + "PdfSaveOptions.DrawingMLEffects.pdf", options);