如何读写PowerPopit 如何使用java的jacob读写PowerPopit文档,想实现为ppt插入幻灯片,插入模板,插入文字,插入图片,设置文子样式,控制显示位置等一些最基本的写操作... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我知道用apache的POI可以解析处理PPT,jacob还没有弄过,不过感觉你这个目标太难达到了,用微软的VBA或者其微软提供的语言倒是靠谱 使用POI控件Java codeimport java.io.InputStream;import org.apache.lucene.document.Document;import org.apache.poi.hslf.HSLFSlideShow;import org.apache.poi.hslf.model.TextRun;import org.apache.poi.hslf.model.Slide;import org.apache.poi.hslf.usermodel.SlideShow;public Document getDocument(Index index, String url, String title, InputStream is)throws DocCenterException{ StringBuffer content = new StringBuffer(""); try{ SlideShow ss = new SlideShow(new HSLFSlideShow(is));//is 为文件的InputStream,建立SlideShow Slide[] slides = ss.getSlides();//获得每一张幻灯片 for(int i=0;i<slides.length;i++){ TextRun[] t = slides[i].getTextRuns();//为了取得幻灯片的文字内容,建立TextRun for(int j=0;j<t.length;j++){ content.append(t[j].getText());//这里会将文字内容加到content中去 } content.append(slides[i].getTitle()); } index.AddIndex(url, title, content.toString()); }catch(Exception ex){ System.out.println(ex.toString()); } return null;} 现在有一个String型的数组,如何把其中的某项数据去掉? quartz cronExpression 配置 问题 struts forward请教 问题相当奇怪 请问可不可以根据表结构,生成hbm.xml和持久化类? 在 Eclipse 下有什么插件能针对 websphere 6.1 呢 htmlparser解析网页问题 请教怎样控制TEXTFIELD的输入字符串的长度 之前说的jboss收费文档有人收到吗?麻烦给我转发一份。100分奉上 请问我是那里错了,我是才学到这,照着视频敲得。 项目上一个叉 weblogic配置问题
import org.apache.poi.hslf.HSLFSlideShow;
import org.apache.poi.hslf.model.TextRun;
import org.apache.poi.hslf.model.Slide;
import org.apache.poi.hslf.usermodel.SlideShow;public Document getDocument(Index index, String url, String title, InputStream is)
throws DocCenterException{
StringBuffer content = new StringBuffer("");
try{
SlideShow ss = new SlideShow(new HSLFSlideShow(is));//is 为文件的InputStream,建立SlideShow
Slide[] slides = ss.getSlides();//获得每一张幻灯片
for(int i=0;i<slides.length;i++){
TextRun[] t = slides[i].getTextRuns();//为了取得幻灯片的文字内容,建立TextRun
for(int j=0;j<t.length;j++){
content.append(t[j].getText());//这里会将文字内容加到content中去
}
content.append(slides[i].getTitle());
}
index.AddIndex(url, title, content.toString());
}catch(Exception ex){
System.out.println(ex.toString());
}
return null;
}