Hello, i'm working in a project that edit an existing Powerpoint with charts and embedded Excels and update the data to save a new document.
With charts i have no problem, following your sample code I update the chart and the spreadsheet at the same time and when I open the new document I can see the new data in slides.
My problem is with embedded Excels, I update the data but PowerPoint remains an .emf cache image of the initial spreadsheet data, so I have to open the powerpoint an double-click the Excel embedded spreadsheet in order to get the new data 'preview' image in the slide.
I have done an autoopen macro that refresh all the cached .emf images when you open the PowerPoint, but it changes the extension from pptx to 'pptm'.
In order to make the pptx4j library 'pptm' compatible, and following this post:
pptx-java-f14/ppsx-support-t754.html
I added the content type in org.docx4j.openpackaging.contenttype.ContentTypes:
PRESENTATION_MACROENABLED = "application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"
And then make a one line addition to org.docx4j.openpackaging.contenttype.ContentTypeManager.createPackage()
else if (pkgContentType.equals(ContentTypes.PRESENTATIONML_MAIN)
|| pkgContentType.equals(ContentTypes.PRESENTATIONML_TEMPLATE)
|| pkgContentType.equals(ContentTypes.PRESENTATIONML_SLIDESHOW)
|| pkgContentType.equals(ContentTypes.PRESENTATION_MACROENABLED)) {
log.info("Detected PresentationMLPackage package ");
p = new PresentationMLPackage(this);
return p;
but i'm getting an error in Load3.addPartsFromRelationships(Base, RelationshipsPart, ContentTypeManager) line: 236:
java.lang.ClassCastException: org.docx4j.openpackaging.parts.DefaultXmlPart
¿ Please could you help me to make a patch to support pptm ? or ¿Any other idea for refreshing the img cache?
Thanks.