It is giving me a bunch of warnings that it cannot modify header information, headers were already sent.
Then I get a bunch of junk where it looks like maybe it's trying to open the file. Here's part of it:
%PDF-1.3 %äãÏÒ 5 0 obj <> stream xœ••MOÂ@†ïüŠ=ꡲ3ýØö"ÑÄ(ÁÞÍFëW 5€ÿ½»E¥ÓvF„4Ìón˜ {!'Û É ƒQ·…LOL›žÏïgöq$Ø‹h9Ñi_û¤Á½{ý‰T°G·#ØÒ„ /òÁ7ÂÀ*Âendstream endobj 6 0 obj 494 endobj 4 0 obj <> endobj 10 0 obj <> >> endobj 3 0 obj <> endobj 7 0 obj <> endobj 8 0 obj <> endobj 9 0 obj <> endobj 1 0 obj <> endobj 2 0 obj <> endobj xref 0 11 0000000000 65535 f 0000001181 00000 n 0000001235 00000 n 0000000599 n 0000000703 00000 n trailer <<1E0E3DA3169373BEFA819F3F8E826981>] >> startxref 1282 %%EOF
Here is the code I copied from the example:
.......
// close and save file
pdf_close($pdf);
// Now we want to display the pdf file in the browser
// In Netscape it will be displayed within the browser using
Adobe
// In IE it will display a File Download screen to allow to save
or open the file
$fp = fopen($filename, "r");
header("Content-Length: " . filesize($filename)); //for IE to
work
header("Content-type: application/pdf");
header("Content-Disposition: inline");
header("Pragma: ");
header("Cache-Control: ");
if(strpos($HTTP_SERVER_VARS['HTTP_USER_AGENT'], 'MSIE'))
{
//IE cannot download from sessions without a cache
header("Cache-Control: public");
header("Content-Disposition: attachment;
filename=report.pdf");
}
fpassthru($fp);
fclose($fp);
} // end of output to a file