到目前为止,我只有一个用于从 ppt 幻灯片笔记中检索文本的工作代码
try {
FileInputStream is = new FileInputStream("C:\\sample\\test.ppt");
SlideShow ppt = new SlideShow(is);
Slide[] slide = ppt.getSlides();
for (int i = 0; i < slide.length; i++) {
System.out.println(i);
TextRun[] runs = slide[i].getNotesSheet().getTextRuns();
if (runs.length < 1) {
System.out.println("null");
} else {
for (TextRun run : runs) {
System.out.println(" > " + run.getText());
}
}
}
} catch (IOException ioe) {
}
但是如何从 pptx 幻灯片中检索文本呢?