Display the pdf file using php | Sanwebcorner

Display the pdf file using php

This post used to display the pdf file in webpages using php. This tip very useful to developer to display the file pdf in web pages ...


<meta charset="utf-8">
<title>Display the pdf file using php</title>
$file = 'dummy.pdf';
$filename = 'dummy.pdf';
header('Content-type: application/pdf');
header('Content-Disposition: inline; filename="' . $filename . '"');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($file));
header('Accept-Ranges: bytes');
<a href="http://www.sanwebcorner.com/">San web corner</a>