windows下仿百度文庫實如今線文檔瀏覽

windows下開發仿百度的功能相對簡單一些。只是java代碼調用服務器windows上安裝的軟件,將doc等文件轉化爲swf文件。html

因爲在開發環境下flashpaper不支持64位的系統,因此用print2flash代替flashpaper,功能效果同樣。java

注:print2flash轉化獲得的swf文件用flexpaper沒法顯示。windows

  • java調用print2flash的代碼以下:瀏覽器

String cmd = "F:/Program Files (x86)/Print2Flash3/p2fServer.exe E:/aa.doc E:/aa.swf";
try {
	// 建立進程,並執行
	Process pro = Runtime.getRuntime().exec(cmd);
	pro.waitFor();
} catch (Exception e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
}
  • 轉化後的swf文件只須要瀏覽器安裝flashplayer插件就能夠打開了,在頁面標籤內無需使用flexpaper這樣的工具。頁面調用swf文件代碼以下:服務器

<embed height="510" width="660" src="swf/aa.swf" loop="true" quality="1" type="application/x-shockwave-flash" />
相關文章
相關標籤/搜索