If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
I'm not sure what you did. Just link straight to the pdf file? Are you sure you're path is ok? In general if you need to download a pdf you need to output the correct html sequence to do so. Below is a generic code which can be exported using a blank application which will download the file. If you make the filename and path a global var then it will become a pretty generic solutions for this.
$file = $_GET["file"] .".pdf";
header("Content-Disposition: attachment; filename=" . urlencode($file));
header("Content-Description: File Transfer");
header("Content-Length: " . filesize($file));
flush(); // this doesn't really matter.
$fp = fopen($file, "r");
echo fread($fp, 65536);
flush(); // this is essential for large downloads
That is only supported if your browser has a pdf reader installed or embedded. e.g. adobe reader, maxthon 4, etc...
If you insist in having it displayed in html you need somethin like pdf2htmlEX or https://github.com/mozilla/pdf.js. There are other solutions as well but these are easy.