Click or drag to resize

OoxmlCompliance Enumeration

Allows to specify which OOXML specification will be used when saving in the DOCX format.

Namespace:  Aspose.Words.Saving
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 20.8.0

Syntax

public enum OoxmlCompliance

Members

  Member nameValueDescription
Ecma376_20060 ECMA-376 1st Edition, 2006.
Iso29500_2008_Transitional1 ISO/IEC 29500:2008 Transitional compliance level.
Iso29500_2008_Strict2 ISO/IEC 29500:2008 Strict compliance level.

Examples

Shows conversion VML shapes to DML using ISO/IEC 29500:2008 Strict compliance level.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Set Word2003 version for document, for inserting image as VML shape
doc.CompatibilityOptions.OptimizeFor(MsWordVersion.Word2003);
builder.InsertImage(ImageDir + "Transparent background logo.png");

Assert.AreEqual(ShapeMarkupLanguage.Vml, ((Shape)doc.GetChild(NodeType.Shape, 0, true)).MarkupLanguage);

// Iso29500_2008 does not allow VML shapes
// You need to use OoxmlCompliance.Iso29500_2008_Strict for converting VML to DML shapes
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions
{
    Compliance = OoxmlCompliance.Iso29500_2008_Strict,
    SaveFormat = SaveFormat.Docx
};

doc.Save(ArtifactsDir + "OoxmlSaveOptions.Iso29500Strict.docx", saveOptions);

// The markup language of our shape has changed according to the compliance type 
doc = new Document(ArtifactsDir + "OoxmlSaveOptions.Iso29500Strict.docx");

Assert.AreEqual(ShapeMarkupLanguage.Dml, ((Shape)doc.GetChild(NodeType.Shape, 0, true)).MarkupLanguage);

See Also