https://issues.apache.org/bugzilla/show_bug.cgi?id=55714
Bug ID: 55714
Summary: Background image ignored on slide copy
Product: POI
Version: 3.10-dev
Hardware: PC
Status: NEW
Severity: normal
Priority: P2
Component: XSLF
Assignee: [email protected]
Reporter: [email protected]
Created attachment 30982
--> https://issues.apache.org/bugzilla/attachment.cgi?id=30982&action=edit
Input file with a background image
Hi and thank you for this great library. I'm using 3.10-beta2
I try to copy some slides from a presentation to a new blank presentation, like
this :
XMLSlideShow srcPptx = null;
try (InputStream is = Resources.getResource("test.pptx").openStream()) {
srcPptx = new XMLSlideShow(is);
}
int slideIndex = 0;
for (XSLFSlide srcSlide : srcPptx.getSlides()) {
XMLSlideShow newPptx = new XMLSlideShow();
// Add slide
XSLFSlide newSlide = newPptx.createSlide();
XSLFSlideLayout srcSlideLayout = srcSlide.getSlideLayout();
XSLFSlideMaster srcSlideMaster = srcSlide.getSlideMaster();
XSLFSlideLayout newSlideLayout = newSlide.getSlideLayout();
XSLFSlideMaster newSlideMaster = newSlide.getSlideMaster();
newSlideLayout.importContent(srcSlideLayout);
newSlideMaster.importContent(srcSlideMaster);
newSlide.importContent(srcSlide);
// Write the new presentation
try (OutputStream os = new FileOutputStream("slide-" + (slideIndex++) +
".pptx")) {
newPptx.write(os);
}
}
It seems to work great, except that background images are not copied.
I join you an input .pptx to reproduce.
Tell me if you need more details.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]