String styleRelId = wordMLPackage.getMainDocumentPart().addTargetPart(style).getId();
// Occupy entire page, less margins
PageDimensions pd = new PageDimensions();
pd.setPgSize(sz, landscape );
PgSz pgSz = pd.getPgSz();
pd.setMargins(margins);
String cx = ""+UnitsOfMeasurement.twipToEMU(pgSz.getW().intValue()
- (pd.getPgMar().getLeft().intValue()+pd.getPgMar().getRight().intValue() ) ); //"5486400";
String cy = ""+UnitsOfMeasurement.twipToEMU(pgSz.getH().intValue()
- (pd.getPgMar().getTop().intValue()+pd.getPgMar().getBottom().intValue() )); //"3200400";
// Now use it in the docx
wordMLPackage.getMainDocumentPart().addObject(
createSmartArt( layoutRelId, dataRelId, colorsRelId, styleRelId, cx, cy));