Loading a pptx is as simple as:
- Code: Select all
PresentationMLPackage presentationMLPackage = PresentationMLPackage.load(file);
Saving is:
- Code: Select all
presentationMLPackage.save(file);
Using the same approach as for docx documents, it represents each part as a JAXB content tree.
To create a "Hello World" presentation, see http://dev.plutext.org/trac/docx4j/browser/trunk/docx4j/src/pptx4j/java/org/pptx4j/samples
All the code you need is in docx4j (docx4j-nightly-20100118.jar). (If building from source, be sure to add src/pptx4j/java to your path.)
See also the docx4j Getting Started guide, available at http://dev.plutext.org/svn/docx4j/trunk/docx4j/docs/
I'm interested of course to hear how you are using or would like to use pptx4j - please post to this forum. Obvious candidates include:
- text extraction
- text substitution / document generation
- conversion/output (HTML, SVG, PDF)
For my part, my interest is in converting to SVG (and back again), HTML and PDF. This means handling DrawingML (and VML)