Created
April 10, 2024 09:44
-
-
Save benheymink/2b06426c3d9374474775c080d40ec00a to your computer and use it in GitHub Desktop.
docx4j pptx loading
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PresentationMLPackage presentationMLPackage = | |
(PresentationMLPackage) OpcPackage.load(new java.io.File("src/resources/testPresentation.pptx")); | |
System.out.printf("Slide count: %d", presentationMLPackage.getMainPresentationPart().getSlideCount()); | |
MainPresentationPart mdp = presentationMLPackage.getMainPresentationPart(); | |
String notesFromSlide = mdp.getSlide(0).getNotesSlidePart().getContents().toString(); | |
System.out.printf("Slide 1 notes: %s", notesFromSlide); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, that works (returns the XML). I'd then need to parse that XML correctly, I was looking for a lovely convenience feature to handle all of that for me :-) - i.e to get just the text contents of the notes, or to update the text of the slide notes. I'll keep digging...
(Thanks for the help btw!)