仿百度文库文档在线预览系统与实现

仿百度文库文档在线预览系统与实现

ID:28497765

大小:233.80 KB

页数:16页

时间:2018-12-10

仿百度文库文档在线预览系统与实现_第1页
仿百度文库文档在线预览系统与实现_第2页
仿百度文库文档在线预览系统与实现_第3页
仿百度文库文档在线预览系统与实现_第4页
仿百度文库文档在线预览系统与实现_第5页
资源描述:

《仿百度文库文档在线预览系统与实现》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库

1、JavaFlexPaperswfTools_仿百度文库文档在线预览系统设计与实现最近在给客户开发文档管理系统时,客户要求上传到管理系统的文档(包括ppt,word,excel,txt)只能预览不允许下载。想到了百度文库和豆丁网,百度文库和豆丁网的在线预览都是利用flash来播放文档的,在网上查阅了大量资料,终于实现了该项功能,现将自己的设计和实现整理如下,自己可以试试。一、如何将文档转成flash支持的swf文件实现在线播放?1.先用openOffice把ppt、word、excel、txt类型的文档转换成pdf2

2、.用swftools将pdf转换成swf,然后利用FlexPaper插件实现在线播放预览。二、具体实现1.安装必备工具组件(1)安装openoffice,openoffice是开源免费的文字处理软件,它可以将office文档转成pdf文件(笔者安装到D:Program Files),openOffice下载地址http://www.openoffice.org/download/index.html(2)安装完openoffice后必须启动其server,以命令行方式启动openofficeserver。进入cm

3、d命令行提示符D:ProgramFilesOpenOffice.org3program键入如下命令:soffice-headless-accept="socket,host=127.0.0.1,port=8100;urp;"–nofirststartwizard进入windows任务管理器查看有个进程soffice.bin,说明openoffice启动成功!(3)安装swfTools(安装到D:ProgramFiles)swftools作用是将pdf转换为swf文件以便flexpaper播放。下载地址:h

4、ttp://www.swftools.org/download.html(4)下载flexpaper,下载地址:http://flexpaper.devaldi.com/download/笔者下载的是FlexPaper_1.5.1,下载后将其解压备用。(5)下载OpenDocument文档转换器JODConverter,JODConverter是一个java的OpenDucument文件转换器,可以进行许多文件格式的转换,它利用OpenOffice来进行转换工作,它能进行以下的转换工作:a.MicrosoftOff

5、ice格式转换为OpenDucument,以及OpenDucument转换为MicrosoftOfficeb.OpenDucument转换为PDF,Word、Excel、PowerPoint转换为PDF,RTF转换为PDF等。下载地址:http://sourceforge.net/projects/jodconverter/files/我们后面开发主要用它的jodconverter-2.2.2.jar包2.软件开发过程(1)启动Eclipse,新建web项目名称为ctcesims(2)将上面第4步解压的flexpa

6、per文件中的js文件夹(包含了flexpaper_flash_debug.js,flexpaper_flash.js,jquery.js,这三个js文件主要是预览swf文件的插件)拷贝至网站根目录;将FlexPaperViewer.swf拷贝至网站根目录下(该文件主要是用在网页中播放swf文件的播放器),目录结构如下图(3)创建documentUpload.jsp文件[html] viewplaincopy1.<%@ page language="java" contentType="text/html; cha

7、rset=UTF-8"  2.    pageEncoding="UTF-8"%>  3.  4.  5.  6.  7.文档在线预览系统</t</p><p>8、itle>  8.<style>  9.    body {margin-top:100px;background:#fff;font-family: Verdana, Tahoma;}  10.    a {color:#CE4614;}  11.    #msg-box {color: #CE4614; font-size:0.9em;text-alig</p> </div> <div class="mt-3 bg-white"> <div class="d-lg-block d-none px-3 px-lg-4 py-3 border-bottom text-center font-18"> 当前文档最多预览五页,下载文档查看全文 </div> <div class="detail-fixed-feature d-none d-lg-block" id="detailFixedFeatureBox"> <div class="px-3 px-lg-4 py-3 d-flex align-items-center justify-content-between fixed-feature-box" id="detailFixedFeature"> <div class="d-lg-flex d-none align-items-center"> <div> <a class="btn btn-outline-danger article-state" href="javascript:;" data-id="28497765" data-code="438274" data-title="仿百度文库文档在线预览系统与实现"> <span>侵权申诉</span> </a> <button type="button" class="btn btn-outline-secondary with-light ml-2" data-toggle="modal" data-target="#reportModal" data-id="28497765"><span>举报</span></button> </div> <nav class="d-flex align-items-center ml-4" id="anchorPoint"> <a href="javascript:;" class="btn btn-light anchor-pre px-2"><i class="iconfont text-muted"></i></a> <div class="text-muted mb-0 pre-point-list" id="prePointList"> <a class="px-2 active nav-link" href="#anchorImg0">1</a> <a class="px-2 nav-link" href="#anchorImg1">1</a> <a class="px-2 nav-link" href="#anchorImg2">2</a> <a class="px-2 nav-link" href="#anchorImg3">3</a> <a class="px-2 nav-link" href="#anchorImg4">4</a> <a class="px-2 nav-link" href="#anchorImg5">5</a> / <span class="px-2" id="prePageNums">16</span> </div> <a href="javascript:;" class="btn btn-light anchor-next px-2"><i class="iconfont text-muted"></i></a> </nav> </div> <div class="d-flex align-items-center"> <p class="d-lg-block d-none font-14 text-black-50 mb-0 mr-2">此文档下载收益归作者所有</p> <button class="btn btn-danger detail-download-btn px-3 ml-0 font-16" data-btn="downloadfile" style="width:128px;height:40px;" data-id="28497765" data-price="1500" data-size="233.80 KB" data-page="16页" data-type="docx" data-binddown="true" data-isold="new_content" data-vip="0" data-title="仿百度文库文档在线预览系统与实现">下载文档</button> </div> </div> </div> </div> <div class="d-block d-lg-none px-3 px-lg-4 py-3 border-bottom text-center font-14" style="color:#999">当前文档最多预览五页,下载文档查看全文</div> <button class="btn d-block w-100 d-lg-none btn-danger detail-download-btn px-3 ml-0 font-16" data-btn="downloadfile" data-id="28497765" data-price="1500" data-size="233.80 KB" data-page="16页" data-type="docx" data-binddown="true" data-isold="new_content" data-vip="0" data-title="仿百度文库文档在线预览系统与实现">点击下载本文档 </button> </div> <div class="px-3 px-lg-4 py-3 bg-white mt-3"> <ul class="nav custom-tab border-bottom" id="myTab" role="tablist"> <li class="nav-item" role="presentation"> <a class="nav-link active px-0 mr-4 font-16 font-weight-light pb-3" id="tips-tab" data-toggle="tab" href="#showTips" role="tab" aria-controls="showTips" aria-selected="true">版权提示</a> </li> <li class="nav-item" role="presentation"> <a class="nav-link px-0 pb-3 font-16 font-weight-light text-black-50" href="/d-28497765.html" >下载文档</a> </li> <dl class="flex-grow-1 mb-0 d-lg-none"> <li class="ml-3 float-right d-lg-none"> <button type="button" class="btn btn-light" data-toggle="modal" data-target="#reportModal" data-id="28497765"><span>举报</span></button> </li> </dl> </ul> <div class="tab-content with-content pt-3" id="myTabContent"> <div class="tab-pane fade show active font-14" id="showTips" role="tabpanel" aria-labelledby="showTips-tab"> 温馨提示: <br> 1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。<br> 2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。<br> 3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。<br> 4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。 <br> </div> </div> </div> </div> <div class="detail-sidebar d-none d-lg-block"> <div id="columnDetailSiderRight"> <div class="detail-yourlike mt-0 pb-2" id="relativeArticle"> <div class="border-bottom py-2 d-flex align-items-center justify-content-between"> <h5 class="font-16">相关文章</h5> <a class="font-14 hover-letter-spacing" href="/ucenter/search/index.html?text=仿百度文库文档在线预览系统与实现" target="_blank" rel="nofollow">更多<i class="iconfont font-12 pl-1"></i></a> </div> <ul class="font-14 like-list"> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-doc" href="/p-438928.html" title="文档教育资源在线预览的设计与实现" target="_blank"><span class="text-danger">文</span><span class="text-danger">档</span>教育资源<span class="text-danger">在</span><span class="text-danger">线</span><span class="text-danger">预</span><span class="text-danger">览</span>的设计<span class="text-danger">与</span><span class="text-danger">实</span><span class="text-danger">现</span></a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-docx" href="/p-1537264.html" title="java实现类似百度文库预览pdf功能" target="_blank">java<span class="text-danger">实</span><span class="text-danger">现</span>类似<span class="text-danger">百</span><span class="text-danger">度</span><span class="text-danger">文</span><span class="text-danger">库</span><span class="text-danger">预</span><span class="text-danger">览</span>pdf功能</a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-docx" href="/p-5198103.html" title="java flexpaper swftools_仿百度文库文档在线预览系统设计与实现" target="_blank">javaflexpaperswftools_<span class="text-danger">仿</span><span class="text-danger">百</span><span class="text-danger">度</span><span class="text-danger">文</span><span class="text-danger">库</span><span class="text-danger">文</span><span class="text-danger">档</span><span class="text-danger">在</span><span class="text-danger">线</span><span class="text-danger">预</span><span class="text-danger">览</span><span class="text-danger">系</span><span class="text-danger">统</span>设计<span class="text-danger">与</span><span class="text-danger">实</span><span class="text-danger">现</span></a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-pdf" href="/p-9220073.html" title="文档在线预览解决方案(仿百度文库)" target="_blank"><span class="text-danger">文</span><span class="text-danger">档</span><span class="text-danger">在</span><span class="text-danger">线</span><span class="text-danger">预</span><span class="text-danger">览</span>解决方案(<span class="text-danger">仿</span><span class="text-danger">百</span><span class="text-danger">度</span><span class="text-danger">文</span><span class="text-danger">库</span>)</a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-docx" href="/p-9793057.html" title="jsp实现文件上传以及类似百度文库在线阅读" target="_blank">jsp<span class="text-danger">实</span><span class="text-danger">现</span><span class="text-danger">文</span>件上传以及类似<span class="text-danger">百</span><span class="text-danger">度</span><span class="text-danger">文</span><span class="text-danger">库</span><span class="text-danger">在</span><span class="text-danger">线</span>阅读</a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-doc" href="/p-11651072.html" title="java flexpaper swftools-仿百度文库文档在线预览系统设计与实现本科学位论文.doc" target="_blank">javaflexpaperswftools-<span class="text-danger">仿</span><span class="text-danger">百</span><span class="text-danger">度</span><span class="text-danger">文</span><span class="text-danger">库</span><span class="text-danger">文</span><span class="text-danger">档</span><span class="text-danger">在</span><span class="text-danger">线</span><span class="text-danger">预</span><span class="text-danger">览</span><span class="text-danger">系</span><span class="text-danger">统</span>设计<span class="text-danger">与</span><span class="text-danger">实</span><span class="text-danger">现</span>本科学位论<span class="text-danger">文</span>.doc</a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-doc" href="/p-11858041.html" title="java flexpaper swftools仿百度文库文档在线预览系统设计与实现学士学位论文.doc" target="_blank">javaflexpaperswftools<span class="text-danger">仿</span><span class="text-danger">百</span><span class="text-danger">度</span><span class="text-danger">文</span><span class="text-danger">库</span><span class="text-danger">文</span><span class="text-danger">档</span><span class="text-danger">在</span><span class="text-danger">线</span><span class="text-danger">预</span><span class="text-danger">览</span><span class="text-danger">系</span><span class="text-danger">统</span>设计<span class="text-danger">与</span><span class="text-danger">实</span><span class="text-danger">现</span>学士学位论<span class="text-danger">文</span>.doc</a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-doc" href="/p-13139162.html" title="java flexpaper swftools仿百度文库文档在线预览系统设计与实现_毕设论文.doc" target="_blank">javaflexpaperswftools<span class="text-danger">仿</span><span class="text-danger">百</span><span class="text-danger">度</span><span class="text-danger">文</span><span class="text-danger">库</span><span class="text-danger">文</span><span class="text-danger">档</span><span class="text-danger">在</span><span class="text-danger">线</span><span class="text-danger">预</span><span class="text-danger">览</span><span class="text-danger">系</span><span class="text-danger">统</span>设计<span class="text-danger">与</span><span class="text-danger">实</span><span class="text-danger">现</span>_毕设论<span class="text-danger">文</span>.doc</a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-docx" href="/p-14896007.html" title="javaflexpaperswftools仿百度文库文档在线预览系统设计与实现" target="_blank">javaflexpaperswftools<span class="text-danger">仿</span><span class="text-danger">百</span><span class="text-danger">度</span><span class="text-danger">文</span><span class="text-danger">库</span><span class="text-danger">文</span><span class="text-danger">档</span><span class="text-danger">在</span><span class="text-danger">线</span><span class="text-danger">预</span><span class="text-danger">览</span><span class="text-danger">系</span><span class="text-danger">统</span>设计<span class="text-danger">与</span><span class="text-danger">实</span><span class="text-danger">现</span></a> </li> <li class=""> <a class="text-ellipsis office-icon text-dark office-icon-docx" href="/p-31726323.html" title="flexpaperswftools实现仿百度文库及一些小问题" target="_blank">flexpaperswftools<span class="text-danger">实</span><span class="text-danger">现</span><span class="text-danger">仿</span><span class="text-danger">百</span><span class="text-danger">度</span><span class="text-danger">文</span><span class="text-danger">库</span>及一些小问题</a> </li> </ul> </div> <div class="detail-yourlike pb-2"> <div class="border-bottom py-2"> <h5 class="font-16">相关标签</h5> </div> <ul class="font-14 like-list d-flex flex-wrap"> <a class="search-tag" href="/tags/1320813/" target="_blank">预览</a> <a class="search-tag" href="/tags/1443606/" target="_blank">文库</a> <a class="search-tag" href="/tags/540547/" target="_blank">文档</a> <a class="search-tag" href="/tags/1068903/" target="_blank">百度</a> <a class="search-tag" href="/tags/1424945/" target="_blank">在线</a> <a class="search-tag" href="/tags/540341/" target="_blank">系统</a> <a class="search-tag" href="/tags/1456203/" target="_blank">实现</a> </ul> </div> <script src="/d/js/acmsd/thea1.js"></script> </div> </div> </div> <footer> <div class="container d-none d-lg-block mb-4"> <div class="d-flex justify-content-between footer-nav"> <ul class="d-flex foot-nav"> <li> <h5>常见问题</h5> <a class=text-decoration-none href=/help/wenti/upload/ target=_blank> 关于上传 </a><a class=text-decoration-none href=/help/wenti/xiazai/ target=_blank> 关于下载 </a><a class=text-decoration-none href=/help/wenti/qinquan/ target=_blank> 关于侵权 </a><a class=text-decoration-none href=/help/wenti/fenxaing/ target=_blank> 分享文档赚钱教程 </a> </li> <li> <h5>关于我们</h5> <a class=text-decoration-none href=/help/about/wzjs/ target=_blank> 网站介绍 </a><a class=text-decoration-none href=/help/about/gywm/ target=_blank> 关于我们 </a><a class=text-decoration-none href=/help/about/lxwm/ target=_blank> 联系我们 </a> </li> <li> <h5>版权问题</h5> <a class=text-decoration-none href=/help/banquan/bqsm/ target=_blank> 版权声明 </a><a class=text-decoration-none href=/help/banquan/qqcl/ target=_blank> 侵权处理 </a><a class=text-decoration-none href=/help/banquan/mzsm/ target=_blank> 免责声明 </a> </li> <li> <h5>协议条款</h5> <a class=text-decoration-none href=/help/xieyi/yhxy/ target=_blank> 用户协议 </a><a class=text-decoration-none href=/help/xieyi/fwtk/ target=_blank> 用户服务条款 </a><a class=text-decoration-none href=/help/xieyi/ysbh/ target=_blank> 用户隐私保护 </a> </li> <li> <h5>网站导航</h5> <a class="text-decoration-none help-nav-item" href="/sitemaps.xml" data-name="网站地图" target="_blank">网站地图</a> <a class="text-decoration-none help-nav-item" href="/list.html" data-name="全部分类" target="_blank">全部分类</a> <a class="text-decoration-none help-nav-item" href="/sitemaps/index.html" data-name="资源地图" target="_blank">资源地图</a> </li> </ul> <div class="foot-qrcode d-flex"> <div> <div class="subsitute-bg"><img src="https://www.wenku365.com/d/file/2022/07-08/f23df57d987ef7ad9acb33fe5abf9854.jpg"></div> <p>关注公众号<br></p> </div> </div> </div> </div> <div class="footer-copyright"> <p><a href="/" target="_blank">天天文库</a>站为“文档C2C交易模式”,即用户上传的文档直接卖给(下载)用户,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有【成交的100%(原创)】。</p> <p>本站是网络服务平台方,若您的权利被侵害,侵权客服QQ:3074922707 欢迎举报。</p> <p>Copyright 2004-2021 <a href="https://www.wenku365.com/" target="_blank">wenku365.com</a> All Rights Reserved <a href="https://beian.miit.gov.cn/#/Integrated/index" rel="nofollow" target="_blank">闽ICP备15016911号-5 </a></p> <p>闽公网安备 <a href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=35052402000320" rel="nofollow" target="_blank">35052402000320</a></p> <p> <a href="https://www.wenku365.com/zt.html" target="_blank">专题文集</a> <a href="https://www.wenku365.com/zt-90007.html" target="_blank">丨职业培训</a> <a href="https://www.wenku365.com/zt-90005.html" target="_blank">丨实用范文</a> <a href="https://www.wenku365.com/zt-90010.html" target="_blank">丨商业材料</a> <a href="https://www.wenku365.com/zt-90013.html" target="_blank">丨合同协议</a> <a href="https://www.wenku365.com/zt-90009.html" target="_blank">丨PPT专题</a></p> </div> </footer> <script src="//static.wenku365.com/wenku365/js/global.min.js?"></script> <script src="//static.wenku365.com/wenku365/js/clipboard.min.js?"></script> <script src="//static.wenku365.com/wenku365/js/jquery.treeview.js?"></script> <script src="//static.wenku365.com/wenku365/js/jquery.share.min.js?"></script> <script src="//static.wenku365.com/wenku365/js/common.min.js?"></script> <script src="//static.wenku365.com/wenku365/js/downloadFile.js?"></script> <script src="//static.wenku365.com/wenku365/js/loginWindow.js?"></script> <script src="//static.wenku365.com/wenku365/js/windowRecharge.js?"></script> <script src="//static.wenku365.com/wenku365/js/viewer.min.js?"></script> <script src="//static.wenku365.com/wenku365/js/detail.js?"></script> <!-- 2023-05-07 03:35:09 --> </body> </html>