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: [email protected]
For additional commands, e-mail: [email protected]