The following code snippet will cause exceptions and errors on many powerpoint documents and will generally result in corrupted file output: Exception handling, imports removed for clarity. public class TestPowerPoint { public static void main(String[] args) { new TestPowerPoint(args[0]); } public TestPowerPoint(String fileToTest) { SlideShow ppt = new SlideShow(new FileInputStream(fileToTest)); for (Slide slide : ppt.getSlides()) { for (TextRun textRun : slide.getTextRuns()) { for (RichTextRun richTextRun : textRun.getRichTextRuns()) { String text = richTextRun.getText(); richTextRun.setText(text); } } } ppt.write(new FileOutputStream("new"+fileToTest)); } }
Please attach the template ppt. Without it, it's hard to tell what is wrong. Yegor
We did not get the necessary PPT attachment for a long time, thus resolving this for now.