对象标签发出双重 pdf 请求
你好 任何人都可以建议我现在需要寻找什么 firefox(Windows 上为 3.6.12)在使用对象标签而不是 iframe 时请求 pdf 两次
对象标签确实有“application/pdf”的 mime 类型
我知道旧的 IE 有当 mime 类型 application/pdf 使 IE 将请求移交给 adobe 插件时,产生两个请求,但我还没有看到 Fx 这样做。
我们正在尝试绕过 Fx 中导致浏览器挂在 PDF 第二页上的最新错误。不,我们不能使用除 Adobe Acrobat Reader 7-9 之外的任何其他插件,并且我们不会将 pdf 更改为其他内容。
谢谢
更新:现在 IE 给我们带来了一个曲线球。它不喜欢在对象内部重定向到相同的域(但不是相同的子域),例如我们加载 a.server.com/pdffile.pdf 并重定向到 b.server.com/otherpdffile.pdf - 在 Fx 中工作正常,但不行在IE中 添加参数 src="urltopdf" 可以使其在 IE 中显示,但会阻止其在 Fx 中工作。叹!
Hi
Can anyone suggest what I need to look for now firefox (3.6.12 on Windows) requests a pdf twice when using the object tag rather than an iframe
The object tag DOES have a mime type of "application/pdf"
I know old IEs had this when the mime type application/pdf made the IE hand over the request to the adobe plugin, resulting in two requests, but I have not see Fx do this.
We are trying to bypass the latest bug in Fx that hangs the browser on the second page of a PDF. And no, we cannot use any other plugin than Adobe Acrobat Reader 7-9 and no we will not change from pdf to something else.
thanks
Update: Now IE is throwing us a curveball. It does not like a redirect inside the object to the same domain (but not same subdomain) e.g. we load a.server.com/pdffile.pdf and redirect to b.server.com/otherpdffile.pdf - works fine in Fx but not in IE
Adding the param src="urltopdf" makes it sort of show in IE but stops it from working in Fx. SIGH!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我怀疑有问题的 PDF 是“启用网络的”,又名“线性化的”……可能包括带有“第 2 页错误”的 PDF。
基本上,线性化 PDF 在文件开头有一堆“提示”,为各个相关位提供字节偏移量,特别是显示第一页所需的字节范围(需要位于 PDF 的前面)。
读取这些字节范围的请求可以分解为任意数量的 HTTP 请求(包括“一个”)。 iframe 和 iframe 并不特别奇怪。对象标签的行为有所不同。在一种情况下,PDF 拥有自己的整个窗口,在另一种情况下,它必须与 HTML 内容共享:无论包装多么薄,它都被包装了。
或者,其中一个请求可能是 PDF 的开头而不是整个内容,同样与线性化 PDF 相关(尝试确定 PDF 是否线性化,然后读取整个内容)。
在上述任何一种情况下,这是正常行为。 OTOH,如果它两次请求整个 PDF,那是一件坏事......很可能是 PDF 插件中的错误。
I suspect that the PDFs in question are "web enabled", AKA "linearized"... possibly including the ones with the "page 2 bug".
Basically, a linearized PDF has a bunch of "hints" at the beginning of the file giving byte offsets to various relevant bits, particularly the byte range needed to display the first page (which is required to be at the front of the PDF).
Requests to read these byte ranges may be broken up into any number of HTTP requests (including "one"). It's not particularly odd that iframe & object tags behave differently. In one case, the PDF gets an entire window to itself, in the other it must share with HTML content: however thinly wrapped, it is wrapped.
Alternatively, one of the requests could be for the beginning of the PDF rather than the entire thing, again related to linearized PDFs (attempting to determine if the PDF is linearized, then reading the whole thing).
In either of the above cases, this is normal behavior. OTOH, if it's requesting the entire PDF twice, that's A Bad Thing... quite possibly a bug in the PDF plugin.