I have a question, how can I do something like this:
header(\"Content-Disposition: inline; filename=result.pdf\");
header(\"Content-type: application/x-pdf\
My guess is that you're doing something like:
$this->getResponse()
->setHeader('Content-Disposition:inline', ' filename=result.pdf')
->setHeader('Content-type', 'application/x-pdf');
fpassthru($filename);
exit();
or something.
The response here will never be rendered (which renders the headers). The response is rendered during post-action printing, usually.
You will have to directly set the headers (as you noted in the non-oo code), or use $this->getResponse()->sendHeaders() directly.