Busy Developers' Guide to HSLF drawing layer
import java.io.IOException;
import org.apache.poi.hslf.HSLFSlideShow;
import org.apache.poi.hslf.model.Shape;
import org.apache.poi.hslf.model.Slide;
import org.apache.poi.hslf.model.TextShape;
import org.apache.poi.hslf.usermodel.SlideShow;
public class Main {
public static void main(String[] args) throws IOException {
SlideShow ppt = new SlideShow(new HSLFSlideShow(args[0]));
Slide[] slides = ppt.getSlides();
for (Slide slide : slides) {
Shape[] shapes = slide.getShapes();
for (Shape shape : shapes) {
if (shape instanceof TextShape) {
System.out.println(((TextShape) shape).getText());
}
}
System.out.println();
}
}
}
沒有留言:
張貼留言