Richard Korts
asked on
Browser displays one page of a two page document
I have this php:
The php script is called disp_summaryk.php & is referenced like this:
https://www.lakoshvac.com/devdev/disp_summaryk.php?file=pdfsumms/3107summls250.pdf
The displayed pdf file (in the browser Chrome) has one page ONLY showing. When I download the file & open it in Acrobat, it has 2 pages.
How can I modify the php script to show a multi page document?
Or maybe can I just direct the browser to directly display the file without needing this php program?
Thanks
<?php
//error_reporting(E_ALL);
//ini_set('display_errors', '1');
// read file & display. File passed in $_GET
// read file & display. File passed in $_GET
$path = $_GET['file'];
header("Content-type: application/pdf");
header("Content-Disposition: inline; filename=filename.pdf");
echo file_get_contents($path);
exit;
?>
The php script is called disp_summaryk.php & is referenced like this:
https://www.lakoshvac.com/devdev/disp_summaryk.php?file=pdfsumms/3107summls250.pdf
The displayed pdf file (in the browser Chrome) has one page ONLY showing. When I download the file & open it in Acrobat, it has 2 pages.
How can I modify the php script to show a multi page document?
Or maybe can I just direct the browser to directly display the file without needing this php program?
Thanks
Not sure what OS/Chrome version you're using. But in my Win10/newest Chrome combo, the top of the page clearly says "1/2" (and obviously when I press PGDWN key, it goes to page 2)
ASKER
So you mean you put my code somewhere & used it against a two page pdf file?
No, I used your URL you posted.
ASKER
Ok, well the, what now?
I’ll try it in Firefox tomorrow, but if that works,it’s still a HUGE problem. Telling me it works for you doesn’t help.
It has to work in all the major browsers.
Richard
I’ll try it in Firefox tomorrow, but if that works,it’s still a HUGE problem. Telling me it works for you doesn’t help.
It has to work in all the major browsers.
Richard
ASKER
This works in Firefox, Not in Chrome.
How is that possible?
Or is perhaps my Chrome somehow buggy?
Thanks
How is that possible?
Or is perhaps my Chrome somehow buggy?
Thanks
ASKER
It is more complicated than I thought. The FIRST time it displays a specific item in Chrome, it works fine. 2nd and beyond, just ONE page. All have two pages.
But there are a lot of other "impossible" things happening to this project, this MIGHT be connected.
Richard
But there are a lot of other "impossible" things happening to this project, this MIGHT be connected.
Richard
Do you have other URLs, and more PDF's, to show me exactly how to get to "the 2nd time and beyond", as I cannot replicate it right now.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.