Page 1 of 1

How to split input pptx file into a set of slide-files

PostPosted: Tue Apr 10, 2012 4:47 pm
by sp0065
Hello,

Thank you for creating this Java Library!

I need to split input pptx file into a set of slides each stored in the separate output pptx file. When input file gets uploaded to a directory program will be called from my main program (written in PHP) and do the split.

Is it possible to do it with pptx4j? I am beginner in Java so code examples would help.

Thank you!

Re: How to split input pptx file into a set of slide-files

PostPosted: Wed Apr 11, 2012 11:11 am
by jason
Yes, you can do it.

I would create a shell or template presentation from the source pptx, containing everything except the actual slides, and then, for each slide, make a copy of this and insert the slide (and a rel to its associated layout) into it.

You should start by running your pptx through PartsList, to get an idea of its structure. You can also unzip it.

Note that Part /ppt/presentation.xml [org.docx4j.openpackaging.parts.PresentationML.MainPresentationPart] contains in p:sldIdLst a list of all slides (and a rel to each); you'll obviously need this part to list just the individual slide.

Re: How to split input pptx file into a set of slide-files

PostPosted: Wed Apr 11, 2012 11:53 am
by sp0065
Jason,

Thanks for your help. Now I have something to start with.

Also I was thinking about deleting all but one slide and repeat the process for each slide. Will this be another solution?

Thanks!