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 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
builder.insertImage(getImageDir() + "Transparent background logo.png");

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

// 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();
saveOptions.setSaveFormat(SaveFormat.DOCX); + "OoxmlSaveOptions.Iso29500Strict.docx", saveOptions);

// The markup language of our shape has changed according to the compliance type 
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.