使用viewer.html看pdf文件的时候, 默认是不能跨域的
跨域就可能报如下错误
file origin does not match viewer's
解决方法是, 编辑viewer.js, 搜索并注释掉如下代码
if (origin !== viewerOrigin && protocol !== 'blob:') {
throw new Error('file origin does not match viewer\'s');
}
但我觉得, 一般不建议这么做, 因为这样你就控制不了你的网站显示什么内容了,
假如不法分子利用你的网站传播不法信息, 管理部门一看, 这还得了, 就把你的网站给封了.