Class ShapeMarkupLanguage

  • java.lang.Object
    • com.aspose.words.ShapeMarkupLanguage
public class ShapeMarkupLanguage 
extends java.lang.Object

Utility class containing constants. Specifies Markup language used for the shape.


Shows how to set an OOXML compliance specification for a saved document to adhere to.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// If we configure compatibility options to comply with Microsoft Word 2003,
// inserting an image will define its shape using VML.
builder.insertImage(getImageDir() + "Transparent background logo.png");

Assert.assertEquals(ShapeMarkupLanguage.VML, ((Shape) doc.getChild(NodeType.SHAPE, 0, true)).getMarkupLanguage());

// The "ISO/IEC 29500:2008" OOXML standard does not support VML shapes.
// If we set the "Compliance" property of the SaveOptions object to "OoxmlCompliance.Iso29500_2008_Strict",
// any document we save while passing this object will have to follow that standard. 
OoxmlSaveOptions saveOptions = new OoxmlSaveOptions();
saveOptions.setSaveFormat(SaveFormat.DOCX); + "OoxmlSaveOptions.Iso29500Strict.docx", saveOptions);

// Our saved document defines the shape using DML to adhere to the "ISO/IEC 29500:2008" OOXML standard.
doc = new Document(getArtifactsDir() + "OoxmlSaveOptions.Iso29500Strict.docx");

Assert.assertEquals(ShapeMarkupLanguage.DML, ((Shape) doc.getChild(NodeType.SHAPE, 0, true)).getMarkupLanguage());

Field Summary
static final byteDML = 0
Drawing Markup Language is used to define the shape.
static final byteVML = 1
Vector Markup Language is used to define the shape.

    • Field Detail

      • DML = 0

        public static final byte DML
        Drawing Markup Language is used to define the shape. This is the new standard for drawing for Office Open XML which has appeared first in ECMA-376 1st edition (2006), first appeared in MS Word 2007.
      • VML = 1

        public static final byte VML
        Vector Markup Language is used to define the shape. A deprecated format included in Office Open XML for legacy reasons only.