반응형

POI HSLF

Java API To Access Microsoft Powerpoint Format Files



1. POI API Document

http://jakarta.apache.org/poi/apidocs/index.html


2. POI Download

http://www.apache.org/dyn/closer.cgi/jakarta/poi/


3. 간단한 텍스트 읽기

<%@ page import="java.io.*"%>
<%@ page import="org.apache.poi.hslf.model.*"%>
<%@ page import="org.apache.poi.hslf.usermodel.*"%>
<%@ page import="org.apache.poi.hslf.*"%>

<%

    SlideShow src =

          new SlideShow(

          new HSLFSlideShow("C:\\Web\\Tomcat 5.5\\webapps\\ROOT\\test.ppt"));


    Slide[] sl = src.getSlides();


    for (int i = 0; i < sl.length; i++) {
        Slide s = sl[i];
        TextRun[] trs = s.getTextRuns();
        for (int k = 0; k < trs.length; k++) {
            TextRun tr = trs[k];
            System.out.println(tr.getText());
           }
    }

%>


4. 테스트버젼

PPT 2000


Posted by 1010