https://bz.apache.org/bugzilla/show_bug.cgi?id=57835
Bug ID: 57835 Summary: XSLFSlide.importContent fails to create valid slide with Charts and Notes in slide Product: POI Version: unspecified Hardware: PC Status: NEW Severity: normal Priority: P2 Component: XSLF Assignee: [hidden email] Reporter: [hidden email] Created attachment 32666 --> https://bz.apache.org/bugzilla/attachment.cgi?id=32666&action=edit Slide Source and Destination (couple Printshots) Have a presentation with a chart and some notes. Running the code below using the resources attached to this issue (src.pptx) generates the dst.pptx, such file is not being generated correctly, charts and notes are missing as shown in the attached pictures. The dst file can not be opened using powerpoint. POI: poi-ooxml-3.11-20141221 (Latest stable as of today) Java: jdk1.6.0_32 (32 bits) <TESTCODE> import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; import org.apache.poi.xslf.usermodel.XMLSlideShow; import org.apache.poi.xslf.usermodel.XSLFSlide; import org.apache.poi.xslf.usermodel.XSLFSlideLayout; import org.apache.poi.xslf.usermodel.XSLFSlideMaster; public class POITest { public static void main(String[] args) { try { String fnames[] = {"src.pptx"}; OutputStream fos = new FileOutputStream("dst.pptx"); XMLSlideShow ppt_out = new XMLSlideShow(); for (String file : fnames) { FileInputStream fis = new FileInputStream(file); XMLSlideShow src = new XMLSlideShow(fis); for(XSLFSlide srcSlide : src.getSlides()){ XSLFSlide newSlide = ppt_out.createSlide(); XSLFSlideLayout src_sl = srcSlide.getSlideLayout(); XSLFSlideMaster src_sm = srcSlide.getSlideMaster(); XSLFSlideLayout new_sl = newSlide.getSlideLayout(); XSLFSlideMaster new_sm = newSlide.getSlideMaster(); // copy source layout to the new layout new_sl.importContent(src_sl); // copy source master to the new master new_sm.importContent(src_sm); newSlide.importContent(srcSlide); } fis.close(); } ppt_out.write(fos); fos.close(); } catch (IOException e) { } } } </TESTCODE> -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
https://bz.apache.org/bugzilla/show_bug.cgi?id=57835
Alexander <[hidden email]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[hidden email] OS| |All -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57835
Dominik Stadler <[hidden email]> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|unspecified |3.11-FINAL -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57835
--- Comment #1 from Nicolas Cailloux <[hidden email]> --- I also experience this bug. It seems POI succeeds in copying object, but fails in the type. Calling "getShapeName" results in the same name, but when trying to convert, here is what it says: org.apache.poi.POIXMLDocumentPart cannot be cast to org.apache.poi.xslf.usermodel.XSLFChart org.apache.poi.xslf.usermodel.XSLFPictureData cannot be cast to org.apache.poi.xslf.usermodel.XSLFChart Good news: the generated XML for the new chart object is the same as the original XML. The relation ID is the same (in my case, "rId2"). However, when checking in relations file for the slide, "rId2" is not bound to a chart anymore, but to an image. Also, some relations are simply missing. This seems to be a bug about relationships. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57835
Nicolas Cailloux <[hidden email]> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |major Version|3.11-FINAL |3.13-FINAL --- Comment #2 from Nicolas Cailloux <[hidden email]> --- When digging in PPTX archive, the charts are not copied. I have as many charts in the new files than in the original one. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57835
Higune <[hidden email]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[hidden email] -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
In reply to this post by Bugzilla from bugzilla@apache.org
I am also experiencing this bug.poi version is 3.15-beta2
XMLSlideShow pptx = new XMLSlideShow(new FileInputStream(PPT_TEMPLATE));
XSLFSlide slide = pptx.getSlides()[0];
pptx.createSlide().importContent(slide);
OutputStream out = new FileOutputStream("output/pie-chart-demo-output.pptx");
pptx.write(out);
out.close();
when I open the pie-chart-demo-output.pptx,there will be a problem to fix. And fixing over,the copy slide disappears.Is Your problem solved? How to do ? Help me.Many thanks.
|
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57835
Ashok Kumar <[hidden email]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[hidden email] -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57835
antonin pa <[hidden email]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |antonin.perrotaudet@orange. | |com --- Comment #3 from antonin pa <[hidden email]> --- Encountering the exact same bug, that prevents me from using POI to generate power point presentations : I don't see how to *insert* graphs while building a presentation because of this bug. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57835
Sergei Malafeev <[hidden email]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[hidden email] -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57835
--- Comment #4 from Alain Fagot Bearez <[hidden email]> --- A partial fix (only handling the charts) is available as pull request #68: https://github.com/apache/poi/pull/68 However the changes are not focused in solving only this issue, but in preparing for a shared code base for charts handling. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
In reply to this post by Bugzilla from bugzilla@apache.org
https://bz.apache.org/bugzilla/show_bug.cgi?id=57835
Alain Fagot Bearez <[hidden email]> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED --- Comment #5 from Alain Fagot Bearez <[hidden email]> --- While importing the charts has been available since POI 4.0.0, only with revision r1886338 are the notes also imported. -- You are receiving this mail because: You are the assignee for the bug. --------------------------------------------------------------------- To unsubscribe, e-mail: [hidden email] For additional commands, e-mail: [hidden email] |
Free forum by Nabble | Edit this page |