Skip to content

Instantly share code, notes, and snippets.

@tonio
Created February 27, 2009 13:44
Show Gist options
  • Save tonio/71477 to your computer and use it in GitHub Desktop.
Save tonio/71477 to your computer and use it in GitHub Desktop.
<?php
/**
* Returns PDF file whith appropriate headers
*
* @param string $content The file content
*
* @return sfView::NONE
*/
public function renderPDF($content)
{
$r = $this->getResponse();
$r->clearHttpHeaders();
$r->setContentType('application/pdf');
$r->setHttpHeader('Content-Disposition', 'inline; filename="print.pdf"');
return $this->renderText($content);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment