无法在Chrome中加载PDF文档

编程入门 行业动态 更新时间:2024-10-26 12:29:32
本文介绍了无法在Chrome中加载PDF文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的服务器上存储了一个PDF文件.我无法通过URL "sitename/pdfName.pdf" 使用Google Chrome(或Ubuntu Chromium)访问文件;我可以在Internet Explorer或FireFox中访问相同的PDF,而不会出现任何问题.

I have a PDF file stored on my server. I am unable to access the file using Google Chrome (or Ubuntu Chromium) via URL "sitename/pdfName.pdf"; while I am able to access the same PDF in Internet Explorer or FireFox without a problem.

Chrome出现此错误:无法加载PDF文档"

Chrome is giving this error: "Failed to load PDF document"

在此链接中找到错误错误图片.

推荐答案

当我们遇到此问题时,起作用和不起作用的PDF文件之间的唯一区别是PDF文档本身的第一行. 这是导致错误的旧PDF与固定版本之间的区别,如在启用了二进制文件的文本编辑器(在本例中为vim -b)中所见:

When we encountered this problem, the only difference between PDF files that did and did not work was in the fist line of the PDF document itself. Here's the difference between the old PDF that caused the error and the fixed version as seen in a binary-enabled text-editor (in this case vim -b):

原始PDF文件:

%PDF-1.6^M%<e2><e3><cf><d3>^M

修复的PDF文件:

%PDF-1.6^M %<e2><e3><cf><d3>^M

因此问题从根本上得到解决,无需再为受害者安装额外的软件或重新安装chrome.

So the problem was solved at the source, no need to burden the victims with installing extra software or reinstalling chrome.

我不知道这是PDF生成器还是chrome插件出现问题. 根据PDF规范,PDF文档的第一行必须包含PDF版本,但是对于^ M是否为有效的行分隔符,我还是不太清楚.

I don't know if this is a problem with the PDF generator, or with the chrome plugin. According to the PDF specification the first line of a PDF document has to contain the PDF version, but it's not completely clear to me if the ^M is a valid line separator.

更多推荐

无法在Chrome中加载PDF文档

本文发布于:2023-11-27 22:55:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639949.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:加载   文档   Chrome   PDF

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!