I assume you are using the CreateHelloWorld sample.
That in turn relies on PresentationMLPackage.createPackage()
Using java Syntax Highlighting
/**
* Create an empty presentation.
*
* @return
* @throws InvalidFormatException
* @since 2.7
*/
public static PresentationMLPackage createPackage
(SlideSizesWellKnown sz,
boolean landscape
) throws InvalidFormatException
{
// Create a package
PresentationMLPackage pmlPack = new PresentationMLPackage
();
// Presentation part
MainPresentationPart pp
;
try {
pp
= new MainPresentationPart
();
pp.
setJaxbElement(
MainPresentationPart.
createJaxbPresentationElement(sz, landscape
) );
pmlPack.
addTargetPart(pp
);
// // Slide part
// SlidePart slidePart = new SlidePart();
// pp.addSlideIdListEntry(slidePart);
//
// slidePart.setJaxbElement( SlidePart.createSld() );
// Slide layout part
SlideLayoutPart layoutPart
= new SlideLayoutPart
();
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();
throw new InvalidFormatException
("Couldn't create package", e
);
}
// Return the new package
return pmlPack
;
}
Parsed in 0.018 seconds, using
GeSHi 1.0.8.4
In there, SlideLayoutPart.createSldLayout() uses:
Using java Syntax Highlighting
public static SldLayout createSldLayout
() throws JAXBException
{
ObjectFactory factory
= Context.
getpmlObjectFactory();
SldLayout sldLayout
= factory.
createSldLayout();
CommonSlideData cSld
= (CommonSlideData
)XmlUtils.
unmarshalString(COMMON_SLIDE_DATA,
Context.
jcPML,
CommonSlideData.
class);
cSld.
setName("Title Slide");
sldLayout.
setCSld( cSld
);
return sldLayout
;
}
Parsed in 0.014 seconds, using
GeSHi 1.0.8.4
So that's where the title slide layout comes from.
You don't need to use it. And of course you can define whatever layout you like.
Probably your best approach is to start with an empty pptx you've created in Powerpoint, which contains the layouts (and master, theme) you want to use.