Ok, 
I reply to myself.
Add this methods in the controller

    
    public function preDispatch(){
      $this->_helper->layout()->disableLayout();
      $this->_helper->viewRenderer->setNoRender(true);
    }

    public function init(){}

and it works! ;)






From: [email protected]
To: [email protected]
Date: Sun, 11 Oct 2009 10:41:12 +0200
Subject: [fw-general] Zend Pdf: how to output for download?








Hello, 
another pdf question.
After I've created the pdf, how to output it for download?
This is the code I actually use and it doesn't work ( pdf is corrupted )

      $pdfString  = $pdf->render();
      $response = $this->getResponse();
      $response->setHeader('Cache-Control', 'public', true)
                ->setHeader('Content-Description', 'File Transfer', true)
                ->setHeader('Content-Disposition', 'attachment; 
filename=volantino.pdf', true)
                ->setHeader('Content-Type', 'application/pdf', true)
                ->setHeader('Content-Transfer-Encoding', 'binary', true)
                ->appendBody($pdfString);
      $this->_helper->layout->disableLayout(); 
      $this->_helper->viewRenderer->setNoRender(true);

What is the mistake?
Thanks




                                          
Un' immagine personale per Messenger? Crea il tuo Avatar!                       
                  
_________________________________________________________________
Le tue Emoticon ti sembrano poche? Scaricane di nuove!
http://intrattenimento.it.msn.com/emoticon/

Reply via email to