Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8467443
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T15:38:47+00:00 2026-06-10T15:38:47+00:00

How to call the following two lines in magento’s \app\code\core\Mage\Wishlist\Helper\Data.php file $this->_helper->layout()->disableLayout(); $this->_helper->viewRenderer->setNoRender(); Actually

  • 0

How to call the following two lines in magento’s \app\code\core\Mage\Wishlist\Helper\Data.php file

$this->_helper->layout()->disableLayout();   
$this->_helper->viewRenderer->setNoRender();  

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

$pdf->save("hello.pdf");

But When I use the following statement

$pdfString = $pdf->render();
header("Content-Disposition: attachment; filename=myfile.pdf");
header("Content-type: application/x-pdf");
echo $pdfString;

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

$this->_helper->layout()->disableLayout();   
$this->_helper->viewRenderer->setNoRender(); 

in getPdf() function so that, it will not add html contents in pdf documents. Can you help me in this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T15:38:49+00:00Added an answer on June 10, 2026 at 3:38 pm

    Before you echo $pdfString, add the following code to disable view rendering and the layout:

    $vr = Zend_Controller_Action_HelperBroker::getStaticHelper('viewRenderer');
    $vr->setNoRender(true);
    
    $layout = Mage::getSingleton('core/layout');
    $layout->disableLayout();
    

    If the Mage::getSingleton() call doesn’t return the correct layout object, you can also try $layout = $this->getLayout();

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In magento1.7, just write following lines in app\code\core\Mage\Wishlist\Helper\Data.php (Data.php) file public function getpdf() {
Given the following code (which is mostly irrelevant except for the last two lines),
In someone else's code I read the following two lines: x = defaultdict(lambda: 0)
I've been trying to get the following two lines of Python code to run
If I make the following call in PHP it will use my password and
I have a main function in A.cpp which has the following relevant two lines
This are my first two lines: <?php header('Content-Type: application/x-javascript'); And it gives me the
I want to know that difference between following two lines name1 = [[NSString stringWithUTF8String:(char
im having some trouble with the following code: Ext.define('...controller...', { extend: 'Ext.app.Controller', init: function()
first off a short explanation... the following two lines assure that once my website

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.