layoutPart.setJaxbElement( SlideLayoutPart.createSldLayout() );
// slidePart.addTargetPart(layoutPart);
// Slide Master part
SlideMasterPart masterPart = new SlideMasterPart();
pp.addSlideMasterIdListEntry(masterPart);
masterPart.setJaxbElement(masterPart.createSldMaster() );
masterPart.addSlideLayoutIdListEntry(layoutPart);
layoutPart.addTargetPart(masterPart);
// Theme part
ThemePart themePart = new ThemePart(new PartName("/ppt/theme/theme1.xml"));
java.io.InputStream is = ResourceUtils.getResourceViaProperty(
"pptx4j.openpackaging.packages.PresentationMLPackage.DefaultTheme",
"org/docx4j/openpackaging/parts/PresentationML/theme.xml");
themePart.unmarshal(is);
// .. add it in 2 places ..
masterPart.addTargetPart(themePart);
pp.addTargetPart(themePart);
} catch (Exception e) {
e.printStackTrace();