You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Jeff Washburn <jw...@yahoo.com> on 2012/02/04 08:38:17 UTC
XSLFSlide.importContent fails to create valid slide with a single image in slide
Have a presentation down to simplest form of 1 slide with a single image
(src.pptx). Doing the code below that creates a new presentation and merges the
slides from src.pptx (this is from cookbook example)
While the merged.pptx is created, when opening in powerpoint, get the following
error:
PowerPoint found a problem with the content in merged.pptx
PowerPoint can attempt to repair the presentation
If you trust the source of this presentation, click Repair
Upon clicking repair: "PowerPoint removed unreadable content in merged.pptx
[Repaired]. You should review this presenation to determine whether any content
was unexpectedly changed or removed"
Which things are changed: no image, basically have a blank slide that says
"Click to add title" and "Click to add subtitle"
Thanks for your help,
Jeff
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import org.apache.poi.xslf.usermodel.XMLSlideShow;
import org.apache.poi.xslf.usermodel.XSLFSlide;
public class Merge extends Analyze
{
public static void main(String[] args) throws Exception
{
XMLSlideShow ppt = new XMLSlideShow();
FileInputStream is = new FileInputStream("src.pptx");
XMLSlideShow src = new XMLSlideShow(is);
is.close();
for(XSLFSlide srcSlide : src.getSlides())
{
ppt.createSlide().importContent(srcSlide);
}
File f = new File("merged.pptx");
FileOutputStream out = new FileOutputStream(f.getName());
ppt.write(out);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: XSLFSlide.importContent fails to create valid slide with a single image in slide
Posted by Jeff <jw...@yahoo.com>.
Jeff <jwashbur65 <at> yahoo.com> writes:
New bug created in bugzilla:
https://issues.apache.org/bugzilla/show_bug.cgi?id=52687
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: XSLFSlide.importContent fails to create valid slide with a single image in slide
Posted by Jeff <jw...@yahoo.com>.
Yegor Kozlov <yegor.kozlov <at> dinom.ru> writes:
>
> which version of POI? Please try with the latest build from trunk,
> daily builds can be downloaded form here:
> http://encore.torchbox.com/poi-cvs-build/
>
> if the problem is still there, please create a new Bugzilla ticket and
> attach src.pptx and sample code that produces corrupt output.
>
> Yegor
>
> On Sat, Feb 4, 2012 at 11:38 AM, Jeff Washburn <jwashbur65 <at> yahoo.com>
wrote:
> > Have a presentation down to simplest form of 1 slide with a single image
> > (src.pptx). Doing the code below that creates a new presentation and merges
the
> > slides from src.pptx (this is from cookbook example)
> >
> > While the merged.pptx is created, when opening in powerpoint, get the
following
> > error:
> >
> > PowerPoint found a problem with the content in merged.pptx
> > PowerPoint can attempt to repair the presentation
> >
> > If you trust the source of this presentation, click Repair
> >
> >
> >
> > Upon clicking repair: "PowerPoint removed unreadable content in merged.pptx
> > [Repaired]. You should review this presenation to determine whether any
content
> > was unexpectedly changed or removed"
> >
> >
> > Which things are changed: no image, basically have a blank slide that says
> > "Click to add title" and "Click to add subtitle"
> >
> > Thanks for your help,
> > Jeff
Hi Yegor - thanks for the reply.
I'm using POI 3.8 beta 5. I just downloaded and built the latest from trunk,
which shows 3.8 beta 6 - and seeing same issue. Will create a Bugzilla ticket
as you requested and will upload the srx.pptx and the sample java code.
Thanks for this great api!
Jeff
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: XSLFSlide.importContent fails to create valid slide with a single image in slide
Posted by Eugene Bovkun <ev...@gmail.com>.
Yegor Kozlov <yegor.kozlov <at> dinom.ru> writes:
>
> It is likely that "heavy" elements are not fully supported. Objects
> like charts and tables usually refer to other nodes in the OPC
> package and those references are not copied.
>
> Can you upload an example so that we can reproduce the problem?
>
> You are welcome to help us to research it:
>
> (a) Create a simple .pptx file with a chart or table.
> (b) Open PowerPoint, create a blank slide and merge it with (a) .
> (c) Do the same with POI
> (d) unzip (b) and (c) and diff. Have a closer look at slide.xml and
> its relation ships. This is the part that is modified by the merge
> code.
>
> Yegor
>
Yegor. I have made all that you ask in your answer http://permalink.gmane.org/
gmane.comp.jakarta.poi.user/18087. So send to you archive with project that
contain merged files: Hello1 (merged by PowerPoint) and Hello2 (merged by
PresentationMerger.java).
You find project here.
http://turbobit.net/mmzpakbgosrm.html
--
Best regards,
Evgeniy Bovkun.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: XSLFSlide.importContent fails to create valid slide with a single
image in slide
Posted by Yegor Kozlov <ye...@dinom.ru>.
It is likely that "heavy" elements are not fully supported. Objects
like charts and tables usually refer to other nodes in the OPC
package and those references are not copied.
Can you upload an example so that we can reproduce the problem?
You are welcome to help us to research it:
(a) Create a simple .pptx file with a chart or table.
(b) Open PowerPoint, create a blank slide and merge it with (a) .
(c) Do the same with POI
(d) unzip (b) and (c) and diff. Have a closer look at slide.xml and
its relation ships. This is the part that is modified by the merge
code.
Yegor
On Fri, Feb 10, 2012 at 1:29 PM, Eugene Bovkun <Ev...@gmail.com> wrote:
> Yegor Kozlov <yegor.kozlov <at> dinom.ru> writes:
>
>>
>> which version of POI? Please try with the latest build from trunk,
>> daily builds can be downloaded form here:
>> http://encore.torchbox.com/poi-cvs-build/
>>
>> if the problem is still there, please create a new Bugzilla ticket and
>> attach src.pptx and sample code that produces corrupt output.
>>
>> Yegor
>>
>> On Sat, Feb 4, 2012 at 11:38 AM, Jeff Washburn <jwashbur65 <at> yahoo.com>
> wrote:
>> > Have a presentation down to simplest form of 1 slide with a single image
>> > (src.pptx). Doing the code below that creates a new presentation and
> merges the
>> > slides from src.pptx (this is from cookbook example)
>> >
>> > While the merged.pptx is created, when opening in powerpoint, get the
> following
>> > error:
>> >
>> > PowerPoint found a problem with the content in merged.pptx
>> > PowerPoint can attempt to repair the presentation
>> >
>> > If you trust the source of this presentation, click Repair
>> >
>> >
>> >
>> > Upon clicking repair: "PowerPoint removed unreadable content in merged.pptx
>> > [Repaired]. You should review this presenation to determine whether any
> content
>> > was unexpectedly changed or removed"
>> >
>> >
>> > Which things are changed: no image, basically have a blank slide that says
>> > "Click to add title" and "Click to add subtitle"
>> >
>> > Thanks for your help,
>> > Jeff
>> >
>
>
> I have simple problem. When I merge few presentation and if one of it has
> element, heavier than simple layout with text. For eg. slide contain some data
> table or pie diagram. When I open created merged presentation MS powerpoint
> throw the same exception like Dmitriy has. But if source presentations have only
> light element, like text and simple shapes - everything Ok. May be problem with
> reading heavy pptx element?
>
> I use poi-3.8-beta5.
> Code like in presentation merge exaple in cookbook.
>
> Eugene.
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: XSLFSlide.importContent fails to create valid slide with a single image in slide
Posted by Eugene Bovkun <Ev...@gmail.com>.
Yegor Kozlov <yegor.kozlov <at> dinom.ru> writes:
>
> which version of POI? Please try with the latest build from trunk,
> daily builds can be downloaded form here:
> http://encore.torchbox.com/poi-cvs-build/
>
> if the problem is still there, please create a new Bugzilla ticket and
> attach src.pptx and sample code that produces corrupt output.
>
> Yegor
>
> On Sat, Feb 4, 2012 at 11:38 AM, Jeff Washburn <jwashbur65 <at> yahoo.com>
wrote:
> > Have a presentation down to simplest form of 1 slide with a single image
> > (src.pptx). Doing the code below that creates a new presentation and
merges the
> > slides from src.pptx (this is from cookbook example)
> >
> > While the merged.pptx is created, when opening in powerpoint, get the
following
> > error:
> >
> > PowerPoint found a problem with the content in merged.pptx
> > PowerPoint can attempt to repair the presentation
> >
> > If you trust the source of this presentation, click Repair
> >
> >
> >
> > Upon clicking repair: "PowerPoint removed unreadable content in merged.pptx
> > [Repaired]. You should review this presenation to determine whether any
content
> > was unexpectedly changed or removed"
> >
> >
> > Which things are changed: no image, basically have a blank slide that says
> > "Click to add title" and "Click to add subtitle"
> >
> > Thanks for your help,
> > Jeff
> >
I have simple problem. When I merge few presentation and if one of it has
element, heavier than simple layout with text. For eg. slide contain some data
table or pie diagram. When I open created merged presentation MS powerpoint
throw the same exception like Dmitriy has. But if source presentations have only
light element, like text and simple shapes - everything Ok. May be problem with
reading heavy pptx element?
I use poi-3.8-beta5.
Code like in presentation merge exaple in cookbook.
Eugene.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org
Re: XSLFSlide.importContent fails to create valid slide with a single
image in slide
Posted by Yegor Kozlov <ye...@dinom.ru>.
which version of POI? Please try with the latest build from trunk,
daily builds can be downloaded form here:
http://encore.torchbox.com/poi-cvs-build/
if the problem is still there, please create a new Bugzilla ticket and
attach src.pptx and sample code that produces corrupt output.
Yegor
On Sat, Feb 4, 2012 at 11:38 AM, Jeff Washburn <jw...@yahoo.com> wrote:
> Have a presentation down to simplest form of 1 slide with a single image
> (src.pptx). Doing the code below that creates a new presentation and merges the
> slides from src.pptx (this is from cookbook example)
>
> While the merged.pptx is created, when opening in powerpoint, get the following
> error:
>
> PowerPoint found a problem with the content in merged.pptx
> PowerPoint can attempt to repair the presentation
>
> If you trust the source of this presentation, click Repair
>
>
>
> Upon clicking repair: "PowerPoint removed unreadable content in merged.pptx
> [Repaired]. You should review this presenation to determine whether any content
> was unexpectedly changed or removed"
>
>
> Which things are changed: no image, basically have a blank slide that says
> "Click to add title" and "Click to add subtitle"
>
> Thanks for your help,
> Jeff
>
>
> import java.io.File;
> import java.io.FileInputStream;
> import java.io.FileOutputStream;
>
> import org.apache.poi.xslf.usermodel.XMLSlideShow;
> import org.apache.poi.xslf.usermodel.XSLFSlide;
>
> public class Merge extends Analyze
> {
> public static void main(String[] args) throws Exception
> {
> XMLSlideShow ppt = new XMLSlideShow();
> FileInputStream is = new FileInputStream("src.pptx");
> XMLSlideShow src = new XMLSlideShow(is);
> is.close();
>
> for(XSLFSlide srcSlide : src.getSlides())
> {
> ppt.createSlide().importContent(srcSlide);
> }
>
> File f = new File("merged.pptx");
> FileOutputStream out = new FileOutputStream(f.getName());
> ppt.write(out);
> }
> }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
> For additional commands, e-mail: user-help@poi.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org