📜  文件来源与查看器的 pdf.js 不匹配 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:58.906000             🧑  作者: Mango

代码示例1
1. If you're trying to do a crossorigin load you must add your origin in the array
var HOSTED_VIEWER_ORIGINS = ['null', '...', 'yourorigin'];
2. check the protocol from the origin you are getting the resource.
example: 
http://localhost/web/viewer.html?file=https://localhost/xx.pdf
turns into
http://localhost/web/viewer.html?file=http://localhost/xx.pdf