<?php
$dirname = "pdf/";// Directory path
$file = glob($dirname."*pdf");
foreach($file as $string){
//header("Pragma: public", true);
header("Expires: 0"); // set expiration time
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Disposition: inline; filename=".basename($string));
header("Content-Transfer-Encoding: binary");
header("Content-Length: ".filesize($string));
die(file_get_contents($string));
}
?>
I have multiple PDF's located in my system directory and I want them to display one after the other. In the above code, output is for one PDF file. I used foreach loop to iterate as I have multiple PDF's in my directory but I am able to retrieve only one PDF file. Second issue I am facing is, I am not able to view the PDF in full screen mode.I don't want the PDF to get downloaded instead it should display in full screen mode.