記錄幾個(gè)命令吧。
1.先安裝add-apt-repository命令
sudo apt-get install python-software-properties
sudo apt-get install software-properties-common
2.添加源,然后通過(guò)apt-get命令安裝swftools
sudo add-apt-repository ppa:guilhem-fr/swftools
sudo apt-get update
sudo apt-get install swftools
Java端調(diào)用的話
//執(zhí)行命令將其轉(zhuǎn)成swf
String cmd = "/usr/bin/pdf2swf -t "+原始文件+" -o "+目標(biāo)文件 +" -s flashversion=9 -s poly2bitmap ";
Runtime run = Runtime.getRuntime();//返回與當(dāng)前 Java 應(yīng)用程序相關(guān)的運(yùn)行時(shí)對(duì)象
try {
Process p = run.exec(cmd);// 啟動(dòng)另一個(gè)進(jìn)程來(lái)執(zhí)行命令
//取得命令結(jié)果的輸出流
InputStream fis=p.getInputStream();
//用一個(gè)讀輸出流類去讀
InputStreamReader isr=new InputStreamReader(fis);
//用緩沖器讀行
BufferedReader br=new BufferedReader(isr);
String line=null;
//直到讀完為止
while((line=br.readLine())!=null)
{
System.out.println(line);
}
} catch (Exception e) {
e.printStackTrace();
}