Can someone help me how to read pptx file in java?i would prefer if this can be read with apache POI, i have been searched this tutorial but i can't find it.I've been successfully read the ppt file with this code :
try {
FileInputStream fis = new FileInputStream(file);
fs = new POIFSFileSystem(fis);
HSLFSlideShow show = new HSLFSlideShow(fs);
SlideShow ss = new SlideShow(show);
Slide[] slides=ss.getSlides();
for (int x = 0; x < slides.length; x++) {
System.out.println("Slide = " + (x + 1) + " :" + slides[x].getTitle());
TextRun[] runs = slides[x].getTextRuns();
for (int i = 0; i < runs.length; i++) {
TextRun run = runs[i];
if (run.getRunType() == TextHeaderAtom.TITLE_TYPE) {
System.out.println("Slide title " + (i + 1) + ": " + run.getText());
} else {
System.out.println("Slide text run " + (i + 1) + ": " + run.getRunType() + " : " + run.getText());
}
}
}
} catch (IOException ioe) {
ioe.printStackTrace();
}
Can someone tell me what part of this code must be modified to read pptx file?