Tuesday, 10 September 2013

Save the generated file in readonly Zend Pdf

Save the generated file in readonly Zend Pdf

I am able to generate a pdf and show it to the browser. But when I save
this pdf file on my desktop, open it and then close it its giving the
alert "Do you want to save the changes?". I wish to create a readonly pdf
document which customers cannot edit by any tool.
My code is
$this->getResponse()->setHeader('Content-type', 'application/pdf', true);
$this->getResponse()->setHeader('Content-disposition','inline;filename='.$module.'_'.$m_no.'.pdf',
true);
$this->getResponse()->setHeader('Cache-Control: no-cache, must-revalidate');
$this->getResponse()->setHeader('Content-Transfer-Encoding', 'binary', true);
$this->getResponse()->setHeader('Last-Modified', date('r'));
$this->getResponse()->clearBody();
$this->getResponse()->sendHeaders();
$this->getResponse()->setBody($pdf->render());
Any idea or suggestion to achieve the goal heartly welcomed. Thanks !

No comments:

Post a Comment