JAVA¶ÁÈ¡PPTÎļþ
import 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;
}
Ïà¹ØÎĵµ£º
<!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:Verdana;
panose ......
public class Calendar {
/**
* Ö±½ÓµÄ¿ÉÒԲ鿴Ч¹û
* @param args
*/
public static void main(String[] args) {
int year=input.nextInt();//Äê
int month=input.nextInt();//ÔÂ
int yearday=0;//Äê×ÜÌìÊý
//¼ ......
ʹÓÃRuntime.getRuntime().exec()·½·¨¿ÉÒÔÔÚjava³ÌÐòÀïÔËÐÐÍⲿ³ÌÐò¡£
1. exec(String command)
2. exec(String command, String envp[], File dir)
3. exec(String cmd, String envp[])
4. exec(String cmdarray[])
5. exec(String cmdarray[], String envp[])
6. exec(S ......
½ñÌìÓÃÁËÏÂjava.lang.ProcessÀֻ࣬Êdzõ²½µÄѧϰ£¬²¢Ã»ÓÐÉîÈëʵ¼ù£¬ÒòΪ¸Ð¾õËüµÄÓÃ;²¢²»ÊǺܴó£¬Å¼¶û²Å¿ÉÄÜÓÃÉÏ£¬Èç¹ûÒª¾³£Ê¹ÓÃËüµÄÈË¿ÉÒÔ×ÔÐвο¼JDkÎĵµ¡£
¶ÔProcessÀàµÄ¼òҪ˵Ã÷£º
ProcessÀàÊÇÒ»¸ö³éÏóÀ࣬·½·¨¶¼ÊdzéÏóµÄ£¬Ëü·â×°ÁËÒ»¸ö½ø³Ì£¬Ò²¾ÍÊÇÒ»¸ö ......