解决使用pdf.js跨域问题
pdf.js
PDF Reader in JavaScript
项目地址:https://gitcode.com/gh_mirrors/pd/pdf.js
免费下载资源
·
解决使用pdf.js跨域问题
之前实现过在线浏览pdf文件
地址:https://blog.csdn.net/weixin_42276004/article/details/89217008
现在解决跨域问题,其实跨域问题我现在有两种解决方法:一是获取远程地址的文件流,第二种更简单,最简单粗暴的方式就是直接注释掉viewer.js文件中的:
// if (fileOrigin !== viewerOrigin) {
// throw new Error(‘file origin does not match viewer’s’);
// }
这个就是判断是否跨域,我们把这个判断直接注释就不会出跨域问题了。
GitHub 加速计划 / pd / pdf.js
4
0
下载
PDF Reader in JavaScript
最近提交(Master分支:4 个月前 )
61c3ed47
For images that include SMask/Mask entries, ignore an SMask defined in the current graphics state (bug 986450) 4 天前
20d53320
From section [11.6.4.3 Mask Shape and Opacity](https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/PDF32000_2008.pdf#G10.4848628) in the PDF specification:
- An image XObject may contain its own *soft-mask image* in the form of a subsidiary image XObject in the `SMask` entry of the image dictionary (see "Image Dictionaries"). This mask, if present, shall override any explicit or colour key mask specified by the image dictionary's `Mask` entry. Either form of mask in the image dictionary shall override the current soft mask in the graphics state.
5 天前
更多推荐
已为社区贡献1条内容
所有评论(0)