2013年9月6日星期五

On the server side , JSP pages, how to open the local word read-only file and displayed on the page ?

Recently developed website , a problem that is on the server side , JSP pages, how to open the local word read-only file and displayed on the page , how high is there any solution experts , Zhuo positive pageoffice can be done , but can not afford ah , very grateful ah ! ! !
Additional information: not to download this word document , but to the inside word on the page to see the content , nor allow the user to modify , such as Baidu library doing better as friends
--- --- Solution --------------------------------------------
Now there are two ways to achieve ① Txt / Word / Excel / PPT => PDF (OpenOffice + JodConverter) => SWF (pdf2swf) => FlexPaper browsing,
Benefits: Users can immediately after a successful upload browse uploaded files ;
Disadvantages: can only handle small files (1M or so ) , large files can not be converted to swf pdf

② user uploaded, the procedures used by the individual users to upload files FlashPaper analytical , analytical finished users can view,
Advantages: relatively large files can be resolved
Disadvantages : FlashPaper parsing some files , it will pop up a dialog box that can not be loaded , you need to manually click on the program can continue parsing after

see elsewhere , and you can try
------ Solution --------------------------- -----------------
If you just read , upstairs is an analytical method, but it is rather tiring for programmers .
You can not afford pageoffice, then you can use dsoframer. I also have the relevant code . Upstairs is their relative need not be so tired , but it may be slightly smaller with a large diesel .

------ Solution ------------------------------------ --------
<%@ page language="java" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
String id = "1";
%>
<html>
<head>
<title>dsoframer测试</title>
<script type="text/javascript">
var docurl = "";
    function load(){
     //document.all.oframe.CreateNew("Word.Document");   //此处是新建一个word
     document.all.oframe.Open("<%=basePath%>/upload/1.doc",false,"Word.Document");     //此处为打开给定地址的word
    }
</script>
</head>
<body onload="load()"> 
<div>
       <object classid="clsid:00460182-9E5E-11d5-B7C8-B8269041DD57" codebase="dsoframer.ocx" id="oframe" width="75%" height="100%">
         <param name="BorderStyle" value="0">
         <param name="Titlebar" value="1">
         <param name="Toolbars" value="1">
         <param name="Menubar" value="1"> 
       </object>
     </div>
</body>
</html>

mainly to download a dsoframer.ocx control
in Baidu also has dsoframer use , can be set to read-only mode
------ Solution ---------------------- ----------------------


Since into PDF directly with the browser open on the line ah , why turn it into a swf
------ For reference only -------------- -------------------------
such as Baidu library ?
------ For reference only -------------------------------------- -
right, like Baidu library as word rendered contents inside without letting the user to modify word
------ For reference only ---------------- -----------------------
has the code ah ? Great, give the copy to see everyone here studies do ?
------ For reference only -------------------------------------- -
dsoframer.ocx an old version of office controls, poor user experience , bug a lot, if you want to use it , the proposed multi ponder ponder . Similar Baidu library can be made like this, instead of using a control once and for all on the line, the best way is to use pageoffice, speaking not expensive
------ For reference only ----- ----------------------------------
Thank you great God, the problem is resolved, Stingy boss finally agreed use pageoffice the money ... the code is very effective , and I tutor said you can try
------ For reference only -------------------- -------------------
expensive ah , our unit in use pageoffice development, saving time and effort ah

没有评论:

发表评论