Can anybody post some sample code to create a powerpoint presentation.
At least the element hirearchy of a slide ...( like for a docx file document - body - paragraph - run - text. ) .
Also is it mandatory to create a master slide, slide layout, theme before creating a slide.
I tried like
Document ppt= DocumentHelper.createDocument();
Namespace nsPresentationML = new Namespace("p", nameSpace );
Element elSlide = ppt.addElement(new QName("sld",nsPresentationML));
Element elShape = elSlide.addElement(new QName("sp",nsPresentationML));
Element elBody = elShape.addElement(new QName("txBody",nsPresentationML));
Element elParagraph = elBody.addElement(new QName("p",nsPresentationML));
Element elRun = elParagraph.addElement(new QName("r", nsPresentationML));
Element elText = elRun.addElement(new QName("t", nsPresentationML));
elText.setText("Hello Open XML !");
It's creating a pptx file, but I am not able to open it using a viewer.
Thanx in advance
Susan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have succeeded in creating the master slide, slides, relationships, slideLayouts, themes etc. But the Extended properties part - /docParts/app.xml file is not created. Can anybody tell me whether we have to create that explicitly t is the role of app.xml file in pptx package.
Thanx,
Susan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
Can anybody post some sample code to create a powerpoint presentation.
At least the element hirearchy of a slide ...( like for a docx file document - body - paragraph - run - text. ) .
Also is it mandatory to create a master slide, slide layout, theme before creating a slide.
I tried like
Document ppt= DocumentHelper.createDocument();
Namespace nsPresentationML = new Namespace("p", nameSpace );
Element elSlide = ppt.addElement(new QName("sld",nsPresentationML));
Element elShape = elSlide.addElement(new QName("sp",nsPresentationML));
Element elBody = elShape.addElement(new QName("txBody",nsPresentationML));
Element elParagraph = elBody.addElement(new QName("p",nsPresentationML));
Element elRun = elParagraph.addElement(new QName("r", nsPresentationML));
Element elText = elRun.addElement(new QName("t", nsPresentationML));
elText.setText("Hello Open XML !");
It's creating a pptx file, but I am not able to open it using a viewer.
Thanx in advance
Susan
I have succeeded in creating the master slide, slides, relationships, slideLayouts, themes etc. But the Extended properties part - /docParts/app.xml file is not created. Can anybody tell me whether we have to create that explicitly t is the role of app.xml file in pptx package.
Thanx,
Susan