Open PDF File download in PHP
<?php
$file = $pdfName;
$path = “CreditReports/”.$pdfName;
$fr = fopen($path, ‘r’);
$filedata = fread($fr, filesize($path));
fclose($fr);
header ( ‘Content-Length: ‘ . filesize ( $path ) );
header(“Content-type: application/pdf“);
header(“Content-disposition: attachment; filename=$file”);
readfile($path);
?>
Before This we have to Check PDF Function Take a look on the below site
http://www.developertutorials.com/tutorials/php/easy-pdf-generation-in-php-8-02-27-922/