Actually, PDF files can be optimized for streaming: http://acroeng.adobe.com/wp/?page_id=27
It's covered in Annex F of the PDF spec: https://wwwimages2.adobe.com/content/dam/Adobe/en/devnet/pdf...
"Linearized" PDFs have extra info up front to allow streaming and random access (via range requests).
You could try to progressively render the file, pausing when a required forward reference isn't within the data you have downloaded so far.
That seems to be what they do, in my experience.
Re:Firefox introduces PDF viewer
by hackmiester on Wednesday February 20, 2013 @01:57PM
(#5252444)
Well, I imagine that they download the file in the background, and if the viewer seeks to a non-downloaded part of the file, then it just blocks with "Loading" until that part is downloaded.
If I remember correctly the PDF Spec says the files should be read backwards. The object table is at the end of the file.
I wonder how google got around that problem.