Is there any alternative to implementing a stream of PDF files that are on the server?
I would like the browser to download the pdf as it is viewed.
Same as the preview of google books
Is there any alternative to implementing a stream of PDF files that are on the server?
I would like the browser to download the pdf as it is viewed.
Same as the preview of google books
I do not know if this would help, but a PDF embed could not serve you? Just put Google's own PDF embed, look at the code below
<iframe src="http://docs.google.com/gview?url=http://infolab.stanford.edu/pub/papers/google.pdf&embedded=true"style="width:600px; height:500px;" frameborder="0"></iframe>
See an example on JSFiddle
Use the framework PDF.js
is very simple and easy.
I am afraid that you can not control through the server since it is the browser that "pulls" through the PDF file. The browser is going to download the file bit by bit.
Adapting this answer : supposing you want to stream from the link " link "
$data = file_get_contents("http://bar.com/foo.pdf");
header("Content-type: application/octet-stream");
header("Content-disposition: attachment;filename=YOURFILE.pdf");
echo $data;
It's not what it needs exactly, but it's a great start.