2

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!

mplungjan
  • 169,008
  • 28
  • 173
  • 236
  • Does your object tag specify the MIME-type in the tag itself? If you don't, browsers tend to need to make a request (usually a HEAD) to see which object they're supposed to be loading. – EricLaw Dec 07 '10 at 14:33
  • Yes it does have a mime type of application/pdf – mplungjan Dec 07 '10 at 14:57

1 Answers1

1

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.

Mark Storer
  • 15,672
  • 3
  • 42
  • 80
  • Ah well. Hard to know what's going on without seeing the PDF/HTML in question. Can you point us to a web site that demonstrates the problem? – Mark Storer Dec 08 '10 at 17:28
  • No, not yet I am afraid. It is not yet online, and we need to fix this before it goes live. I will try to make a page that shows the issue, but I need to do so on a site where I have access to log files.. Thanks for your participation – mplungjan Dec 09 '10 at 06:18