Sometimes it is required to hide the actual PDF file name for security reason. So using a webpage you can display PDF in browser without knowing the actual URL. Example source: <?php $file = ‘path-to-pdf-file/myFile.pdf’; $filename = ‘download.pdf’; header(‘Content-type: application/pdf’); header(‘Content-Disposition: inline; filename=”‘ . $filename . ‘”‘); header(‘Content-Transfer-Encoding: binary’); header(‘Accept-Ranges: bytes’); @readfile($file); ?> Save this […]
Display PDF in browser via PHP
