hi im trying to display pdf in browser and i used this code to do the work
<?php
$pdf = 'uploads/docs/' . $list->filename;
// dd($pdf);
header('Content-type: application/pdf');
header('Content-Disposition: inline; filename="' . $pdf . '"');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($pdf));
header('Accept-Ranges: bytes');
@readfile($pdf);
exit;
?>
it is working but i have one problem sometimes it does not display 1-2 pages pdf files any idea what i am doing wrong? any advices? thanks