poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 55714] New: Background image ignored on slide copy
Date Mon, 28 Oct 2013 13:57:04 GMT
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: dev@poi.apache.org
          Reporter: benjamin.gam@gmail.com

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: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message