title: disable view rendering in magento
body: <p>How to call the following two lines in magento's <code>\app\code\core\Mage\Wishlist\Helper\Data.php</code> file</p>
  
  <pre><code>$this-&gt;_helper-&gt;layout()-&gt;disableLayout();   
  $this-&gt;_helper-&gt;viewRenderer-&gt;setNoRender();  
  </code></pre>
  
  <p>Actually there is a self created function getPdf() in Data.php which is used to generate pdf of wishlist items. It generates PDF with no error by using the statement</p>
  
  <pre><code>$pdf-&gt;save("hello.pdf");
  </code></pre>
  
  <p>But When I use  the following statement </p>
  
  <pre><code>$pdfString = $pdf-&gt;render();
  header("Content-Disposition: attachment; filename=myfile.pdf");
  header("Content-type: application/x-pdf");
  echo $pdfString;
  </code></pre>
  
  <p>It throws error: Adobe reader couldn't open myfile.pdf because it's not either a supported file type or because the file has been damaged. Now I need to call these two lines</p>
  
  <pre><code>$this-&gt;_helper-&gt;layout()-&gt;disableLayout();   
  $this-&gt;_helper-&gt;viewRenderer-&gt;setNoRender(); 
  </code></pre>
  
  <p>in getPdf() function so that, it will not add html contents in pdf documents. Can you help me in this? </p>