如何在jsp页面中查看pdf文件并下载相同的pdf? [英] how to view pdf file in jsp page and download the same pdf?

查看:351
本文介绍了如何在jsp页面中查看pdf文件并下载相同的pdf?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在jsp页面中查看pdf文件并下载相同的pdf?

how to view pdf file in jsp page and download the same pdf?

推荐答案

只需通过iframe嵌入Google Doc Viewer并指定您想要的PDF文件显示。这是你应该添加的代码:



Just embed Google Doc Viewer through an iframe and specify the PDF file you want to display. This is the code you should add:

<iframe src="http://docs.google.com/gview?url=http://infolab.stanford.edu/pub/papers/google.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0"></iframe>





那么你只需要将自己的文档文件设置为url查询字符串参数就是这样!您不仅可以在任何浏览器中显示PDF,还可以显示查看器支持的任何其他文件,如doc,xls等!



Then you just need to set up your own document file to the "url" query string param and that's it! You can display not just PDF but any other file supported by the viewer like doc, xls, etc. in any browser!


这篇关于如何在jsp页面中查看pdf文件并下载相同的pdf?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆