public class OoxmlCompliance
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 int | ECMA_376_2006 | |
ECMA-376 1st Edition, 2006.
|
||
static final int | ISO_29500_2008_TRANSITIONAL | |
ISO/IEC 29500:2008 Transitional compliance level.
|
||
static final int | ISO_29500_2008_STRICT | |
ISO/IEC 29500:2008 Strict compliance level.
|
public static final int ECMA_376_2006
public static final int ISO_29500_2008_TRANSITIONAL
public static final int ISO_29500_2008_STRICT