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 8461937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T14:01:10+00:00 2026-06-10T14:01:10+00:00

In magento1.7, just write following lines in app\code\core\Mage\Wishlist\Helper\Data.php (Data.php) file public function getpdf() {

  • 0

In magento1.7, just write following lines in app\code\core\Mage\Wishlist\Helper\Data.php (Data.php) file

  public function getpdf()
     {
     $pdf = new Zend_Pdf(); 
    $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);
    for($i=0; $i<5; $i++) {
    $page = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);
    $page->setFont($font, 24) ->drawText('Hello World page '.$i, 72, 720);
    $pdf->pages[] = $page;
     }
   $pdfString = $pdf->render();
   header("Content-Disposition: attachment; filename=myfile.pdf");
   header("Content-type: application/x-pdf");
   echo $pdfString;
   }

Call this function

  <?php  Mage::helper('wishlist')->getpdf();?>

in app\design\frontend\base\default\template\wishlist\view.phtml (view.phtml)file just before <div class="my-wishlist"> line. Now run magento in browser and login. Then click on My wishlist link and it will show myfile.pdf in downlods folder. When it is opened it throws error message.Now replace these lines

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

with

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

Then open mydoc.pdf in magento1.7 folder, it’s opened with no error and displays “Hello World” on each pages of Pdf document. Now compare these two files “myfile.pdf” and “mydoc.pdf” in text editor, you will see presence of html contents in “myfile.pdf”.
My problem is that I am not able to find a way for removing these html contents from generated PDF document. Can anybody help me in resolving this issue.
Please note that above code is just a demostration of what I did.

  • 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-10T14:01:12+00:00Added an answer on June 10, 2026 at 2:01 pm

    There is more than one way to skin a cat. I take it you want a nice PDF of the wishist. Consider using wkhtml2pdf to make it. This will involve styling up the PRINT version of the page – there is a CSS that gets added for that if media=print, which is the case with wkhtml2pdf.

    The reslts of wkhtml2pdf are vastly better than anything ‘hand drawn’ with Zend PDF stuff.

    To get started install wkhtml2pdf and simply run it on the command line, tinkering with the options until it comes out half way decent.

    The only downside to wkhtml2pdf is you have no control on the page breaks.

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

Sidebar

Related Questions

Magento 1.4.1.1 Back in history, app/code/core/Mage/GoogleAnalytics/Block/Ga.php was copied over to app/code/local/Mage/GoogleAnalytics/Block/Ga.php and changes were
What is your average Magento Core API response time? I'm getting ~1.5seconds just to
I'm creating a Magento module that saves user-input data to an xml file (held
I just installed magento along with it's sample data. I set the about page
I've just installed Magento on my website, but I can't access the backend. The
I was just reading about Magento , a free framework for easily creating an
I've just installed a local copy of Magento. For some reason, importing the sample
I have a custom magento template which im trying to tweak and just have
When creating a Magento multistore, can the 2nd store not just use a directory
Can some professional experienced Magento developer tell me how to accomplish the following in

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.