public class ShapeMarkupLanguage
Example:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
// Set Word2003 version for document, for inserting image as VML shape
doc.getCompatibilityOptions().optimizeFor(MsWordVersion.WORD_2003);
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.setCompliance(OoxmlCompliance.ISO_29500_2008_STRICT);
saveOptions.setSaveFormat(SaveFormat.DOCX);
doc.save(getArtifactsDir() + "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 byte | DML | |
Drawing Markup Language is used to define the shape.
|
||
static final byte | VML | |
Vector Markup Language is used to define the shape.
|
public static final byte DML
public static final byte VML