poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Beeker <kiwiwi...@apache.org>
Subject Re: How to refresh embedded content in a pptx using Apache POI?
Date Thu, 04 Feb 2016 01:28:49 GMT
> ... but unfortunately this preview won’t be the updated spreadsheet. Is that correct?

> Do you know how this preview is stored in the new format (.pptx, office 2007)?
It is usually an EMF under /ppt/media/image<1,2,3,...>.emf
the embedded documents are usually under /ppt/embeddings/oleObject<1,2,3,..>.bin,
which are ole2 containers - you can use POIFS to read those and extract the "PACKAGE" entry.
My preferred tool to handle ole2 containers is "SS Viewer" [2]

> I’ve tried to convert the .pptx file to a .zip archive ...
Convert?? There is a cool command line tool since MS DOS 1.1: "> ren *.pptx *.zip" ;)

I've just created an example ppt with an embedded excel -
have a try on the sample code [3] and see if it works ...
of course you need to use the correct slide / shape index
(As mentioned above) Office usually uses EMF images for embedded objects, so I've created
a clickMe.emf.
Replacing the preview image with a different image format would be a bit more hassle,
as you would need to replace the references too ... so the quick and dirty version is to
have several clickMe images and use the one which correspondents with the original
content type.
If you are really fancy, you could check out FreeHEP VectorGraphics and
load the original image (EMFImageLoader), write something like "refresh me" over it
and use their graphics context to write an emf image out again.

@Javen: I think something like this makes sense. The problem with embedded excel
sheets is, they aren't standalone excel files, but some kind of subset.
There's an open bug for HSLF (#54213) and there was already a discussion here or on
stackoverflow (can't find it currently) which was about those xlsx data tables objects ...
similar to [1]


[1] http://apache-poi.1045710.n5.nabble.com/Workarounds-solutions-to-embed-worksheets-to-Slides-using-POI-tt2300252.html#a4372242
[2] http://www.mitec.cz/ssv.html
[3] http://pastebin.com/RX0mSHLj

To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org

View raw message