- Code: Select all
<p:sp xmlns:a="http://schemas.openxmlformats.org/drawingml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:p="http://schemas.openxmlformats.org/presentationml/2006/main">
<p:nvSpPr>
<p:cNvPr id="2" name="Rectangle 1"/>
</p:nvSpPr>
<p:txBody>
<a:bodyPr rtlCol="0" anchor="ctr"/>
<a:lstStyle/>
<a:p>
<a:r>
<a:rPr lang="en-US" dirty="0" smtClean="0">
<a:solidFill>
<a:schemeClr val="tx1"/>
</a:solidFill>
</a:rPr>
<a:t>Auto Shape txt 1</a:t>
</a:r>
</a:p>
</p:txBody>
<p:nvSpPr>
<p:cNvPr id="2" name="Rectangle 1"/>
</p:nvSpPr>
<p:txBody>
<a:bodyPr rtlCol="0" anchor="ctr"/>
<a:lstStyle/>
<a:p>
<a:r>
<a:rPr lang="en-US" dirty="0" smtClean="0">
<a:solidFill>
<a:schemeClr val="tx1"/>
</a:solidFill>
</a:rPr>
<a:t>Auto Shape txt 2</a:t>
</a:r>
</a:p>
</p:txBody>
</p:sp>
I saved this part as a text file and gave it as an input to a Java project. The relevant java part is mentioned in the below.
- Code: Select all
File file = new File("D:\\PPTtxtInput\\slide1.txt");
String pptInput = deserializeString(file);
Shape sample = (Shape) (XmlUtils.unmarshalString(pptInput,
Context.jcPML));
slidePart.getJaxbElement().getCSld().getSpTree().getSpOrGrpSpOrGraphicFrame().
add(sample);
Even I input this it doesn't show 1st auto shapes details in the slide. Do you have any idea? Thank you