You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Allison, Timothy B." <ta...@mitre.org> on 2014/04/02 18:14:03 UTC
removing attachments from ppt
POI Colleagues,
I'd like to delete/remove attachments from a ppt. I followed the directions here:
http://poi.apache.org/slideshow/how-to-shapes.html#OLE
with one modification to remove shapes only of type OLEShape:
for (Shape sh : slide.getShapes()){
if (sh instanceof org.apache.poi.hslf.model.OLEShape){
slide.removeShape(sh);
}
}
When I try to open the file in PPT, I get a "PPT found a problem, would you like to repair?" message. PPT is then able to repair the file and the attachments are gone. However, is there something else I can do to prevent PPT from having to repair the file?
Thank you.
Best,
Tim
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
RE: removing attachments from ppt
Posted by Nick Burch <ap...@gagravarr.org>.
On Thu, 3 Apr 2014, Allison, Timothy B. wrote:
> Ah, so it wasn't obvious user error...that was the response I was
> suspecting. :) If it isn't an obvious user error, should I open an
> issue with example files?
Probably best, if you could. Yegor is our PPT guru, I've largely forgotten
most of the details of the format, so not sure when someone could take a
look...
>> From PPDrawingTextListing for the "removed" file:
> ....Found PPDrawing at 1 in top level record 4 (1006)
> Has 2 textbox wrappers within
> 0 has 2 PPT atoms within
> 1 has 2 PPT atoms within
>
>> From "removed_repaired" file:
>
> Found PPDrawing at 1 in top level record 4 (1006)
> Has 2 textbox wrappers within
> 0 has 3 PPT atoms within
> 1 has 3 PPT atoms within
Could be interesting to check what those atoms are within the PPDrawings.
SlideShowRecordDumper or PPTXMLDump will give a lot of output, but you
can hopefully narrow in fairly quickly on these areas to check
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
RE: removing attachments from ppt
Posted by "Allison, Timothy B." <ta...@mitre.org>.
Ah, so it wasn't obvious user error...that was the response I was suspecting. :) If it isn't an obvious user error, should I open an issue with example files?
>From PPDrawingTextListing for the "removed" file:
....Found PPDrawing at 1 in top level record 4 (1006)
Has 2 textbox wrappers within
0 has 2 PPT atoms within
1 has 2 PPT atoms within
>From "removed_repaired" file:
Found PPDrawing at 1 in top level record 4 (1006)
Has 2 textbox wrappers within
0 has 3 PPT atoms within
1 has 3 PPT atoms within
>From SlideIdListing:
>From the "removed" file:
There are 7 sheets under
Found PersistPtrIncrementalBlock at 87535 (155ef)
However, from the "removed_repaired" file, there are just 5 sheets
-----Original Message-----
From: Nick Burch [mailto:apache@gagravarr.org]
Sent: Wednesday, April 02, 2014 2:15 PM
To: POI Users List
Subject: Re: removing attachments from ppt
On Wed, 2 Apr 2014, Allison, Timothy B. wrote:
> When I try to open the file in PPT, I get a "PPT found a problem, would
> you like to repair?" message. PPT is then able to repair the file and
> the attachments are gone. However, is there something else I can do to
> prevent PPT from having to repair the file?
If you save the repaired file, and then use the hslf dev tools, how does
the POI generated file differ from the repaired one?
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org<ma...@poi.apache.org>
For additional commands, e-mail: user-help@poi.apache.org<ma...@poi.apache.org>
Re: removing attachments from ppt
Posted by Nick Burch <ap...@gagravarr.org>.
On Wed, 2 Apr 2014, Allison, Timothy B. wrote:
> When I try to open the file in PPT, I get a "PPT found a problem, would
> you like to repair?" message. PPT is then able to repair the file and
> the attachments are gone. However, is there something else I can do to
> prevent PPT from having to repair the file?
If you save the repaired file, and then use the hslf dev tools, how does
the POI generated file differ from the repaired one?
Nick
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org