简体   繁体   English

如何在浏览器Spring MVC中显示上载的doc(ms word)和PDF

[英]How to display uploaded doc (ms word) & PDF in browser Spring MVC

I designed a spring MVC application where User can upload doc or pdf files to application and it will be stored in My SQL. 我设计了一个Spring MVC应用程序,用户可以在其中将doc或pdf文件上传到应用程序,并将其存储在My SQL中。

I made download link so that user can download the uploaded file and it works fine. 我做了下载链接,以便用户可以下载上载的文件,并且可以正常工作。

How could we make it readable online (without downloading) in User's browser(like www.scribd.com )? 我们如何在用户的浏览器(如www.scribd.com )中使其在线可读(无需下载)? (As of now I made tag <embed src="${pageContext.request.contextPath}/ebook/${ebook.filename}" width="1000" height="2000" /> tag in HTML, PDF views perfect as PDF reader is installed in PCand PDF plugin is installed in browser but doc file not displayed) (到目前为止,我在HTML中将标签<embed src="${pageContext.request.contextPath}/ebook/${ebook.filename}" width="1000" height="2000" />标记为HTML, PC中安装了PDF阅读器,浏览器中安装了PDF插件,但未显示doc文件)

Here he says browsers doesn't support viewing PDF files.(even .doc files) 在这里说浏览器不支持查看PDF文件(甚至.doc文件)。

Is there any plugins do render uploaded doc/pdf files in the browser to be read online? 是否有任何插件可以在浏览器中呈现上传的doc / pdf文件以在线阅读?

请访问http://viewerjs.org,我仅对PDF进行了最少的尝试(它似乎可以正常工作),但他们也宣传能够渲染Office文档的功能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM