I am developing a Joomla component, and one of the views should display itself as a PDF. In the view, I tried to set the content type with the following line, but when I see the answer, it is text / html anyway.
header('Content-type: application/pdf');
If I do this on a regular php page, everything works as expected. It seems I need to tell Joomla to use the / pdf application instead of text / html. How can i do this?
Note. Setting other headers, such as Content-Disposition , works as expected.
Antoine aubry
source share