我使用以下代码使用apache poi将html转换为ppt,但它只是将html代码复制到ppt中,渲染没有发生。
import org.apache.poi.hslf.model.Slide;
import org.apache.poi.hslf.model.TextBox;
import org.apache.poi.hslf.usermodel.SlideShow;
public class apachePOI {
public static void main(String[]args){
try{
File file = new File("Hello.html");
FileInputStream fis = null;
BufferedInputStream bis = null;
DataInputStream dis = null;
fis = new FileInputStream(file);
bis = new BufferedInputStream(fis);
dis = new DataInputStream(bis);
String st="";
while (dis.available() != 0) {
st+=dis.readLine().toString()+"\n";
}
System.out.println(st);
SlideShow slideShow = new SlideShow();
Slide slide = slideShow.createSlide();
TextBox txt = new TextBox();
txt.setText(st+" ");
slide.addShape(txt);
FileOutputStream out = new FileOutputStream("Hello.ppt");
slideShow.write(out);
out.close();
bis.close();
dis.close();
}
catch(Exception e){}
}
}
有什么建议吗?