I am using Magento CE and would like to alter some parts of the .pdf invoices that can be printed from the 'invoices' section of the site. enter image description here

As you can see in the image above, I would like to alter the colours of the grey area towards the top as well as remove the reference to shipping charges in the 'Shipping Methods' section.

Any pointers would be really useful as this is proving really hard for me.

Thanks for any and all replies.


To get rid of the 'Total Shipping Charges' section...





then on line 445


$totalShippingChargesText = "(" . Mage::helper('sales')->__('Total Shipping Charges') . " "
                . $order->formatPriceTxt($order->getShippingAmount()) . ")";


$totalShippingChargesText = "";
  • I wonder why the Total Shipping Charges is displayed without the tax.
    – Webninja
    Aug 27, 2014 at 13:46

1 Answer 1


In the same file the Mage_Sales_Model_Order_Pdf_Abstract::insertOrder method is what draws the header part of the PDF. To change gray background to white, change:

$page->setFillColor(new Zend_Pdf_Color_GrayScale(0.45));


$page->setFillColor(new Zend_Pdf_Color_GrayScale(1));

before the line

$page->drawRectangle(25, $top, 570, $top - 55);

To change color to black in the same file change:

$page->setFillColor(new Zend_Pdf_Color_GrayScale(1));


$page->setFillColor(new Zend_Pdf_Color_GrayScale(0));

right after drawRectangle call.

You will have to do the same in Mage_Sales_Model_Order_Pdf_Abstract::insertDocumentNumber() because that is where Invoice # is added.

With all of the above said, you are better off with doing local module which overrides the abstract class or the invoice class. And in it just change what you need. This way in case of future changes in the Abstract.php file in core code pool you will inherit new features and retain your changes as well.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.