如何实现pdf.js在pdf查看器中查看pdf文件? [英] how to implement pdf.js to view pdf files in the pdf viewer?

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

问题描述

我想在pdf.js查看器的新页面中打开链接到文档中的pdf文件.

i want to open pdf files that are linked to in a document in a new page in the pdf.js viewer.

我已经从github下载了zip文件:

i have downloaded the zip file from github:

https://github.com/mozilla/pdf.js

并转到examples文件夹中的两个index.html文件.

and gone to both of the index.html files in the examples folder.

打开这些文件之一时,我得到空白页.

i get blank pages when opening either of these files.

有人可以告诉我如何实现pdf.js,以便我可以在pdf查看器的新页面中打开pdf文档吗?

can anyone please tell me how to implement pdf.js so that i can open pdf documents in a new page in the pdf viewer?

谢谢.

推荐答案

请尝试在带有Viewer.html的查询字符串中使用'?file = url'.
例如:www.example.com/pdf-js/web/viewer.html?File="URL"

Try using '?file=url' in query-string with viewer.html.
For example: www.example.com/pdf-js/web/viewer.html?File="URL"

来源: github上的pdf-js

是的,如果您不使用任何网络服务器,肯定会遇到跨域问题,如@Silent所述.

And yes, you will most definitely have cross-domain issues if not using any web-server, as mentioned by @Silent.

干杯.

这篇关于如何实现pdf.js在pdf查看器中查看pdf文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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