title: How do I set the Content-type in Joomla?
body: <p>I am developing a Joomla component and one of the views needs to render itself as PDF. In the view, I have tried setting the content-type with the following line, but when I see the response, it is text/html anyways.</p>
  
  <pre><code>header('Content-type: application/pdf');
  </code></pre>
  
  <p>If I do this in a regular php page, everything works as expected. It seems that I need to tell Joomla to use application/pdf instead of text/html. How can I do it?</p>
  
  <p>Note: Setting other headers, such as <code>Content-Disposition</code>, works as expected.</p>