乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      !!!!! 仿百度文庫實(shí)現(xiàn)文檔在線預(yù)覽

       看見就非常 2013-08-20
       

      仿百度文庫實(shí)現(xiàn)文檔在線預(yù)覽

       

      在線閱讀



      一.分析

       

      實(shí)現(xiàn)方式

      ①   

      Txt/Word/Excel/PPT=>PDF(OpenOffice+JodConverter)=>SWF(pdf2swf)=>FlexPaper瀏覽

      ②   

      Txt/Word/Excel/PPT=>PDF(MSOffice+JACOB)=>SWF(pdf2swf)=>FlexPaper瀏覽

      ③   

      Txt/Word/Excel/PPT=>SWF (FlashPaper)=> FlexPaper瀏覽

      ④   

      Txt/Word/Excel/PPT=>SWF(print2flash)=> FlexPaper瀏覽

      前兩種方式比較麻煩,都是先轉(zhuǎn)成PDF,再轉(zhuǎn)成SWF,最后用FlexPaper瀏覽。后兩種比較快捷,可直接將源文件轉(zhuǎn)為SWF,用FlexPaper瀏覽。由于FlashPaper不是開源工具,加之Win7系統(tǒng)不兼容(我現(xiàn)在用的系統(tǒng)),所以就沒采用第三種實(shí)現(xiàn)方式。Print2flash是開源工具,即使公司產(chǎn)品中用到也不會(huì)出現(xiàn)版權(quán)糾紛,遺憾的是沒找到如何用程序控制該工具轉(zhuǎn)換文件的命令。第二種方式轉(zhuǎn)PDF的時(shí)候相當(dāng)復(fù)雜,也淘汰掉了。最后直接用的第一種方式。

       

       

      二.功能所需工具

      下載工具

      OpenOffice

      http://zh./new/zh_cn/downloads.html

      JodConverter

      http://dldx.csdn.net/fd.php?i=992314146801277&s=08dbee95a6e2dda1a95aa8cbf4df197b

      Swftools(pdf2swf)

      http://dldx.csdn.net/fd.php?i=389133735472350&s=2f7430ad3c00cca78ada8b4671a50b24

      xpdf-chinese-simplified.tar.gz (pdf2swf的中文語言包)

      ftp://ftp.foolabs.com/pub/xpdf/xpdf-chinese-simplified.tar.gz

      FlexPaper

      http://flexpaper./files/FlexPaper_1.4.5_flash.zip

       

      本來想把自己實(shí)際用到?jīng)]問題的安裝文件上傳上來,但是太大了,無法共享。 當(dāng)時(shí)的下載地址又找不到了,好吧,悲催了。截圖自己用到的版本

       

      三、搭建所需環(huán)境及實(shí)現(xiàn)

      第一步:安裝OpenOffice。從上述下載地址得到可執(zhí)行安裝文件,直接雙擊執(zhí)行,安裝過程較為人性化,只需選擇下一步即可。此處注意下安裝路徑,文件轉(zhuǎn)換之前需在Windows命令行窗口打開安裝根目錄,然后執(zhí)行開啟服務(wù)命令。

      第二步:解壓JodConverter。解壓目錄結(jié)構(gòu)如下圖:

      打開lib文件夾,

      將其中的jar包復(fù)制到Web工程的WebRoot/WEB-INF/lib下。

      第三步:安裝Swftools。從下載的壓縮包中解壓得到可執(zhí)行安裝文件,直接雙擊執(zhí)行。該轉(zhuǎn)換工具用來將pdf文件轉(zhuǎn)換成swf文件。改工具既可以安裝使用實(shí)現(xiàn)文件轉(zhuǎn)換,也拷貝安裝后Program Files下的Swftools文件夾放到工程中,以綠色軟件方式來使用。轉(zhuǎn)換命令將在FileConverterUtil.java中特別指明。

      第四步:使用Flexpaper。Flexpaper就是一個(gè)播放swf文件的播放器。解壓后目錄如下:

      其中Paper.swf、所有的txt文件、php文件夾和example文件夾都可以刪掉。清理完之后,新建readFile.jsp(jsp頁面代碼在后面附加),然后將flexpaper文件夾拷貝到WebRoot下即可。

      FileConverterUtil.java代碼如下:

       

       

       

      import java.io.BufferedReader;

      import java.io.File;

      import java.io.IOException;

      import java.io.InputStream;

      import java.io.InputStreamReader;

      import java.io.LineNumberReader;

      import java.util.HashMap;

      import java.util.List;

      import java.util.Properties;

       

      import org.apache.struts2.ServletActionContext;

       

      import com.artofsolving.jodconverter.DocumentConverter;

      importcom.artofsolving.jodconverter.openoffice.connection.OpenOfficeConnection;

      importcom.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection;

      import com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter;

      import com.doone.comm.paginaction.Pagination;

      import com.doone.comm.struts.BaseAction;

      import com.doone.knowledge.info.dao.KnowledgeInfoDao;

       

       

      /**

       * 課件資源管理

       * @authorhsp

       *

       */

      public class KnowledgeInfoAction2 extends BaseAction{

       

         private Paginationpage = new Pagination();// 分頁對(duì)象  

         private KnowledgeInfoDaoknowledgeInfoFacade;

         private HashMap<String,Object>knowledgeInfoMap = newHashMap<String,Object>();

        

        

         /**

          * 獲取知識(shí)信息

          * @return

          */

         @SuppressWarnings("unchecked")

         public String seeKnowledgeInfo()throws Exception{

            String id=this.getRequest().getParameter("kinfoid");

           

            //信息評(píng)論分頁:

            //設(shè)置每頁顯示多少條

            page.setPageRecord(5);

            //求出總記錄數(shù)并判斷是否為第一次查詢

              if(getQueryFlag("page") == -1) {

                 page.setTotalRecord(knowledgeInfoFacade.getKnowledgeRecommentCount(id));

              } else {

                 page.setTotalRecord(getQueryFlag("page"));

             }

              //設(shè)置查詢條件

            this.setPageParameters(page,"page");

            //結(jié)果List

            HashMap infoMap = knowledgeInfoFacade.getKnowledgeInfoInfo(id,page.getPageStart(),page.getPageRecord());

            knowledgeInfoMap=(HashMap)infoMap.get("kinfo");

            if(infoMap.get("krecomment")!=null&&!"".equals(infoMap.get("krecomment"))){

               List list=(List)infoMap.get("krecomment");

               this.getRequest().setAttribute("recommentList", list);

            }

            //文件類別

            String fileType =this.knowledgeInfoMap.get("KNOWLEDGE_FILE_TYPE").toString().substring(1,knowledgeInfoMap.get("KNOWLEDGE_FILE_TYPE").toString().length());

           

            //是否可預(yù)覽標(biāo)志  0普通文檔,MP3,SWF,可以預(yù)覽  ,       1 不支持的文件類型,不能預(yù)覽        2,MP4播放

            String previewFlag=""

            String returnValue="";

            //可以預(yù)覽的文件

            if(fileType.equals("XLS")  || fileType.equals("PPT") || fileType.equals("DOC") ||fileType.equals("PDF") || fileType.equals("TXT") || fileType.equals("MP3") ||fileType.equals("SWF")){

               previewFlag = "0";

               returnValue="nomp4";

            }else if(fileType.indexOf(".MP4")>0){

               returnValue="mp4";

               previewFlag = "2";

            }else{

               returnValue="nomp4";

               previewFlag = "1";

            }

            System.out.println("fileType==========="+fileType+"=========="+ previewFlag+ previewFlag.equals("0"));

           

            /**************************************以下為文件預(yù)覽*****************************************************/

            if(previewFlag.equals("0")){

                  //服務(wù)器信息

                  Properties props=System.getProperties();

                  //不同系統(tǒng)分隔符

                  String separator=props.getProperty("file.separator");

                  //系統(tǒng)版本Linux,Window XP,Window 7

                  String os_name=props.getProperty("os.name");

                  String os_flag="";

                  if(os_name.indexOf("Linux")==0){

                      os_flag="linux";

                  }else if(os_name.indexOf("Windows")==0){

                      os_flag="window";

                  }

                 

                  //服務(wù)器存儲(chǔ)的文件名稱     201212171709212889.doc

                  String sysFileName=this.knowledgeInfoMap.get("KNOWLEDGE_PATH").toString();

                  //文件原名      年會(huì)活動(dòng)初稿請(qǐng)車友定稿.doc

                  String oriFileName =this.knowledgeInfoMap.get("KNOWLEDGE_FNAME").toString();

                 

                 

                  //文件完整路徑

                  //window下是一個(gè)反斜杠 \

                  //linux 是一個(gè)正斜杠/home/apache-tomcat-6.0.33/webapps/jd/WebRoot/upload/knowledge/201212181318342606.ppt

                  String fullPath =ServletActionContext.getServletContext().getRealPath(separator+"upload"+separator+"knowledge"+separator+sysFileName);

                  //文件夾名稱絕對(duì)路徑   F:\\workspace\\doone-jdedu\\WebRoot\\upload\\knowledge

                  StringfolderName=fullPath.substring(0,fullPath.lastIndexOf(separator));

                  //sysFileName保持一致,如果已經(jīng)存在,不再每次生成

                  String sysFileName_temp =sysFileName.substring(0,sysFileName.lastIndexOf("."));

                  //工程的絕對(duì)路徑

                  String basePath =this.getRequest().getScheme()+"://"+this.getRequest().getServerName()+":"+this.getRequest().getServerPort()+this.getRequest().getContextPath();

                 

                  File sourceFile;            //轉(zhuǎn)換源文件

                  File pdfFile;               //PDF媒介文件

                  File swfFile;               //SWF目標(biāo)文件

                  File createPath;            //創(chuàng)建文件存放目錄

                  Runtime rt;                 //轉(zhuǎn)換命令執(zhí)行類

                  String finalFilePath = "";    //最終顯示在前臺(tái)的轉(zhuǎn)換之后的SWF文件名稱

                  String swfToolsPath ="";       //swfTools 安裝路徑,

                  if(os_flag.equals("linux")){

                      swfToolsPath="";

                  }else{

                     swfToolsPath ="C:\\Program Files\\SWFTools\\";

                  }

                 

                 

                   //swf

                  if(fileType.equals("SWF")){

                      //文件原路徑

                      finalFilePath = basePath+separator+"upload"+separator+"knowledge"+separator+sysFileName;

                      System.out.println("It'sSWF=================="+finalFilePath);

                  }

                   //pdf

                  if(fileType.equals("PDF")){

                      //PDF格式文件處理方式

                      rt = Runtime.getRuntime();

                      sourceFile = new File(fullPath);

                      //創(chuàng)建SWF文件存放目錄

                      createPath = new File(folderName+separator+"swfFiles"+separator);

                      if(!createPath.isDirectory()){

                         createPath.mkdir();

                      }

                      swfFile = new File(folderName+separator+"swfFiles"+separator+sysFileName_temp+".swf");

                      //為了避免版本問題,不用7,8版本,用9

                      Process p= null;

                      if(os_flag.equals("window")){

                          p =rt.exec(swfToolsPath+"pdf2swf.exe" + sourceFile.getPath() +" -o " +swfFile.getPath() + " -T 9");

                      }else{

                          p =rt.exec("pdf2swf -slanguagedir=/usr/local/xpdf-chinese-simplified -T 9 -s poly2bitmap -s zoom=150-s flashversion=9 "+ sourceFile.getPath()+" -o "+swfFile.getPath());

                      }

                      //各系統(tǒng)清理緩存

                      if(os_flag.equals("window")){

                         clearCache(p.getInputStream(),p.getErrorStream());

                      }else if(os_flag.equals("linux")){

                          InputStreamReader ir=newInputStreamReader(p.getInputStream()); 

                          LineNumberReader input = new LineNumberReader(ir); 

                          Stringline; 

                          while ((line =input.readLine ()) !=null){ 

                            System.out.println("linux clear===================="+line);

                          } 

                      }

                      finalFilePath = basePath+separator+"upload"+separator+"knowledge"+separator+"swfFiles"+separator+sysFileName_temp+".swf";

                      System.out.println("It'sPDF=========sourceFile"+sourceFile.getPath()+"========="+swfFile+"========="+finalFilePath);

                  }

                  //pdf,非swf

                  else{

                      System.out.println("It's "+fileType+"===================="+sysFileName_temp);

                      //PDF格式文件處理方式

                      if(isLegal(fileType.toUpperCase())){

                         sourceFile = new File(fullPath);

                         pdfFile = new File(folderName+separator+"swfFiles"+separator+sysFileName_temp+".pdf");

                         swfFile = new File(folderName+separator+"swfFiles"+separator+sysFileName_temp+".swf");

                         if(!pdfFile.exists()){

                            //獲取連接對(duì)象

                            OpenOfficeConnection connection = newSocketOpenOfficeConnection(8100);

                            //取得連接

                            connection.connect();

                            //創(chuàng)建文件格式轉(zhuǎn)換對(duì)象

                            DocumentConverter converter = newOpenOfficeDocumentConverter(connection);

                            //實(shí)現(xiàn)文件格式轉(zhuǎn)換

                            converter.convert(sourceFile, pdfFile);

                            //生成已轉(zhuǎn)換的PDF文件

                            pdfFile.createNewFile();

                            //釋放連接

                            connection.disconnect();

                            System.out.println("create a new pdf=========="+pdfFile.getParent());

                            if(!swfFile.exists()){

                                  rt = Runtime.getRuntime();

                                  //執(zhí)行PDF文件轉(zhuǎn)換成SWF文件命令

                                  //linux命令: pdf2swf -slanguagedir=/usr/local/xpdf-chinese-simplified-T 9 -s poly2bitmap -s zoom=150 -sflashversion=9"/home/s.pdf" -o "/home/%.swf"

                                  Process p= null;

                                  if(os_flag.equals("window")){

                                      p = rt.exec(swfToolsPath+"pdf2swf.exe " + pdfFile.getPath() +" -o " + swfFile.getPath() + " -T 9");

                                  }else{

                                      p = rt.exec("pdf2swf -s languagedir=/usr/local/xpdf-chinese-simplified -T 9 -spoly2bitmap -s zoom=150 -s flashversion=9 "+ pdfFile.getPath() +" -o "+swfFile.getPath());

                                  }

                                  //各系統(tǒng)清理緩存

                                  if(os_flag.equals("window")){

                                     clearCache(p.getInputStream(),p.getErrorStream());

                                  }elseif(os_flag.equals("linux")){

                                      InputStreamReader ir=newInputStreamReader(p.getInputStream()); 

                                      LineNumberReader input = new LineNumberReader(ir); 

                                      String line; 

                                      while ((line = input.readLine ()) !=null){ 

                                        System.out.println("linux clear===================="+line);

                                      } 

                                  }

                                  System.out.println("create a new swf=========="+swfFile.getParent());

                            }

                         }else{

                            //如果已經(jīng)存在了pdf,但是swf由于某種原因不存在

                            if(!swfFile.exists()){

                               rt = Runtime.getRuntime();

                               //執(zhí)行PDF文件轉(zhuǎn)換成SWF文件命令

                               //linux命令: pdf2swf -slanguagedir=/usr/local/xpdf-chinese-simplified-T 9 -s poly2bitmap -s zoom=150 -sflashversion=9 "/home/s.pdf"-o "/home/%.swf"

                               Process p= null;

                               if(os_flag.equals("window")){

                                   p= rt.exec(swfToolsPath+"pdf2swf.exe" + pdfFile.getPath() +" -o " +swfFile.getPath() + " -T 9");

                               }else{

                                   p= rt.exec("pdf2swf -s languagedir=/usr/local/xpdf-chinese-simplified-T 9 -s poly2bitmap -s zoom=150 -s flashversion=9 "+ pdfFile.getPath() +" -o "+swfFile.getPath());

                               }

                               //各系統(tǒng)清理緩存

                               if(os_flag.equals("window")){

                                  clearCache(p.getInputStream(),p.getErrorStream());

                               }elseif(os_flag.equals("linux")){

                                   InputStreamReader ir=newInputStreamReader(p.getInputStream()); 

                                   LineNumberReader input = new LineNumberReader(ir); 

                                   String line; 

                                   while ((line =input.readLine ()) !=null){ 

                                     System.out.println("linux clear===================="+line);

                                   } 

                               }

                               System.out.println("pdf exists,but create a new swf=========="+swfFile.getParent());

                              }

                            System.out.println("pdf exists=========="+swfFile.getParent());

                         }

                         finalFilePath = basePath+separator+"upload"+separator+"knowledge"+separator+"swfFiles"+separator+sysFileName_temp+".swf";

                        

                      }

                  }

                  //可以預(yù)覽的,放解析后的文件完整路徑到頁面

                  this.getSession().setAttribute("finalFilePath", finalFilePath);

            }

            this.getSession().setAttribute("previewFlag",previewFlag);

            this.getSession().setAttribute("fileType",fileType);

            return returnValue;

         }

        

        

         /**

          * 清理緩沖區(qū)

          * @param isi

          * @param ise  

          */

         public void clearCache(InputStream isi, InputStream ise){

            try {

            System.out.println("clearCache==========="+isi.toString()+"============"+ise.toString());

               final InputStream is1 = isi;

               //啟用單獨(dú)線程清空InputStream緩沖區(qū)

               new Thread(new Runnable() {

                   public void run() {

                      System.out.println("before BufferedReader=========================");

                       BufferedReaderbr = new BufferedReader(new InputStreamReader(is1));

                       try {

                         while(br.readLine() !=null) ;

                      } catch (IOException e) {

                         e.printStackTrace();

                      }

                   }

               }).start();

               //讀入ErrorStream緩沖

               System.out.println("333333333333333333333333");

               BufferedReader br = new BufferedReader(new InputStreamReader(ise));

               //保存緩沖輸出結(jié)果

               StringBuilder buf = new StringBuilder();

               String line = null;

               try {

                  System.out.println("beforereadLine==================");

                  line = br.readLine();

               } catch (IOException e) {

                  e.printStackTrace();

               }

               //循環(huán)等待進(jìn)程結(jié)束

               while(line !=null)

                  buf.append(line);

               is1.close();

               ise.close();

               br.close();

            } catch (Exception e) {

               System.out.println("clearCacheException==========="+e+"============");

               e.printStackTrace();

            }

         }

        

        

         /**

          * 判斷所轉(zhuǎn)換文件類型是否合法

          * @paramgetFileType //文件格式

          * @param fileLegalFlag  //是否合法標(biāo)志  false:非法   true:合法

          */

        

         public boolean isLegal(String getFileType){

            boolean fileLegalFlag =false;

            if(getFileType.equals("TXT")){

               fileLegalFlag = true;

            }else if(getFileType.equals("DOC")||getFileType.equals("DOCX")){

               fileLegalFlag = true;

            }else if(getFileType.equals("PPT")||getFileType.equals("PPTX")){

               fileLegalFlag = true;

            }else if(getFileType.equals("XLS")||getFileType.equals("XLSX")){

               fileLegalFlag = true;

            }

            return fileLegalFlag;

         }

        

      }

       

       

       

       

       

       

      readFile.jsp頁面代碼如下:

      <%@ page language="java"import="java.lang.String"pageEncoding="UTF-8"%>

      <%

      String path =request.getContextPath();

      String getFilePath =request.getParameter("recFileName");

      String basePath =request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

      %>

       

       

      <!DOCTYPEHTML PUBLIC "-//W3C//DTDHTML 4.01 Transitional//EN">

      <htmlxmlns="http://www./1999/xhtml"lang="en"xml:lang="en">

        <head>

         

          <title>在線閱讀</title>

              <styletype="text/css"media="screen">

               html, body  { height:100%; }

               body { margin:0padding:0overflow:auto; }  

               #flashContent { display:none; }

              </style>

            <!--

            <script type="text/javascript"src="js/flexpaper_flash.js"></script>

             -->

             <scripttype="text/javascript"src="${pageContext.request.contextPath}/knowledge/info/js/jquery.js"></script>

             <scripttype="text/javascript"src="${pageContext.request.contextPath}/knowledge/info/js/flexpaper_flash_debug.js"></script>

             <scripttype="text/javascript"language="javascript"src="${pageContext.request.contextPath}/knowledge/info/js/flexpaper_flash.js"></script>\

           

        </head>

       

        <body>

        <divstyle="position:absolute;left:200px;top:0px;">

                <%    //是否可預(yù)覽   0可預(yù)覽   1 不可預(yù)覽

                      StringpreviewFlag=(String)session.getAttribute("previewFlag");

                      //文件類型  swf的直接播放

                       StringfileType=(String)session.getAttribute("fileType");

                       //swf,MP3預(yù)覽

                      if(previewFlag.equals("0") &&!fileType.equals("SWF") && !fileType.equals("MP3"))  {

                      %>

                <aid="viewerPlaceHolder"style="width:1000px;height:778px;display:block">http://172.0.6.26:8081/jd/upload/knowledge/swfFiles <%=(String)session.getAttribute("finalFileName")%>/</a>

                 <scripttype="text/javascript">

                   var fp =new FlexPaperViewer( 

                          '<%=basePath%>knowledge/info/FlexPaperViewer',

                          'viewerPlaceHolder', { config : {

                          SwfFile :escape('<%=(String)session.getAttribute("finalFilePath")%>'),

                          Scale :0.6,

                          ZoomTransition : 'easeOut',

                          ZoomTime :0.5,

                          ZoomInterval : 0.2,

                          FitPageOnLoad : true,

                          FitWidthOnLoad : false,

                          PrintEnabled : false,

                          FullScreenAsMaxWindow : false,

                          ProgressiveLoading : true,

                          MinZoomSize: 0.2,

                          MaxZoomSize: 5,

                          SearchMatchAll : false,

                          InitViewMode : 'Portrait',

                          

                          ViewModeToolsVisible : true,

                          ZoomToolsVisible : true,

                          NavToolsVisible : true,

                          CursorToolsVisible : true,

                          SearchToolsVisible : true,

                        

                          localeChain: 'zh_CN'

                          }});

                 </script>

                  <%}

                      //swf預(yù)覽

                      else if(previewFlag.equals("0") &&fileType.equals("SWF")){

                   %>

                        <objectid="FlashID"classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"width="1000"height="778">

                                   <paramname="movie"value="<%=(String)session.getAttribute("finalFilePath")%>"/>

                                   <paramname="quality"value="high"/>

                                   <paramname="wmode"value="opaque"/>

                                   <paramname="swfversion"value="8.0.35.0"/>

                                   <!--  param標(biāo)簽提示使用 Flash Player 6.0 r65和更高版本的用戶下載最新版本的 Flash Player。如果您不想讓用戶看到該提示,請(qǐng)將其刪除。 -->

                                   <paramname="expressinstall"value="Scripts/expressInstall.swf"/>

                                   <!-- 下一個(gè)對(duì)象標(biāo)簽用于非 IE 瀏覽器。所以使用 IECC 將其從 IE 隱藏。 -->

                                   <!--[if !IE]>-->

                                   <objecttype="application/x-shockwave-flash"data="${pageContext.request.contextPath}/images/jdindeximages/fla.swf"width="960"height="209">

                                    <!--<![endif]-->

                                    <paramname="quality"value="high"/>

                                    <paramname="wmode"value="opaque"/>

                                    <paramname="swfversion"value="8.0.35.0"/>

                                    <paramname="expressinstall"value="Scripts/expressInstall.swf"/>

                                    <!-- 瀏覽器將以下替代內(nèi)容顯示給使用 Flash Player 6.0和更低版本的用戶。 -->

                                    <div>

                                      <h4>此頁面上的內(nèi)容需要較新版本的 Adobe Flash Player。</h4>

                                     <p><ahref="http://www.adobe.com/go/getflashplayer"><imgsrc="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif"alt="獲取 Adobe Flash Player" width="112"height="33"/></a></p>

                                    </div>

                                    <!--[if !IE]>-->

                                  </object>

                              <!--<![endif]-->

                         </object>

                         <%

                       }

                      //mp3預(yù)覽

                      else if(previewFlag.equals("0") &&fileType.equals("MP3")){

                       %>

                        <objectclassid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="640"height="90"id="rp">

                                   <paramname="autostart"value="1"/>

                                    <paramname="controls"value="IMAGEWINDOW,ControlPanel,StatusBar"/>

                                    <paramname="console"value="Clip1"/>

                                    <paramname="type"value="audio/x-pn-realaudio-plugin"/>

                                   <paramname="src"value="rtsp://172.0.0.16:554/knowledge/${knowledgeInfoMap.KNOWLEDGE_PATH}"/>

                        </object>

                       <%

                      }

                       //不能預(yù)覽的

                      else if(previewFlag.equals("1")){

                       %>

                         

                         對(duì)不起,不支持預(yù)覽,請(qǐng)直接下載

                      <%

                      }

                   %>

              </div>

         </body>

      </html>

       

       

       

       

       

      windows下OpenOffice服務(wù)啟動(dòng)命令:

      cd C:\Program Files\OpenOffice.org 3\program

      soffice -headless-accept="socket,host=127.0.0.1,port=8100;urp;" –nofirststartwizard

      啟動(dòng)后在進(jìn)程中可以看到soffice

       

      linux 下openoffice啟動(dòng)命令:

      /opt/3/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard &

       

       

       

       

      需注意的問題

      轉(zhuǎn)換TXT時(shí)內(nèi)容中文亂碼問題

      反編譯jodconverter-2.2.2.jar,反編譯好的已經(jīng)放在在線閱讀文件夾下。Jodconverter-2.2.1.jar不出現(xiàn)TXT亂碼問題,但是不支持office2007格式的文件轉(zhuǎn)換。

      Flexpaper不支持中文路徑

      中文名稱的文件轉(zhuǎn)換成了漢語拼音.swf

       

      參考資料

      http://topic.csdn.net/u/20110712/18/4daf5746-e64e-434d-aeb0-77b05f6c9903.html

      http://www.cnblogs.com/qinpeifeng107/archive/2011/08/29/2158879.html

      http://blog.csdn.net/liuyuhua0066/article/details/6603493

      http://blog.csdn.net/lyq123333321/article/details/6546104

      http://www.cnblogs.com/compass/articles/2046311.html

       

      Swftools在linux下安裝: http://www.cnblogs.com/jony413/articles/2650765.html

       



      在網(wǎng)友基礎(chǔ)上改進(jìn),時(shí)間太久,忘記出處,表示歉意和感謝。


      另附本文檔,源代碼及部分安裝文件的下載地址:http://download.csdn.net/detail/qingwangyoucao/5043933

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶 評(píng)論公約

        類似文章 更多