I have a script that creates a PDF dynamically using PDFlib. That part works great......I just can't seem to send the right http header back to the browser to display the PDF. I want the PDF to open in the same location as the script, so I DON'T want to use the "Location" header!
Anyway, here's what I have:
/*
code to create pdf.....
resulting document is stored in $pdffile....
*/
header("Content-Type: application/pdf");
readfile($pdffile);
All I get when I execute this is the byte stream of the pdf file! Shouldn't the browser know what to do with the file contents since I'm sending the "Content-Type" header??