The file you are looking for is app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php
. I have marked the two lines you'll need to change with // <--
. The documentation for Zend_Pdf_Color_GrayScale will tell you that 0.0
is black, 1.0
is white.
protected function insertOrder(&$page, $obj, $putOrderId = true)
{
if ($obj instanceof Mage_Sales_Model_Order) {
$shipment = null;
$order = $obj;
} elseif ($obj instanceof Mage_Sales_Model_Order_Shipment) {
$shipment = $obj;
$order = $shipment->getOrder();
}
/* @var $order Mage_Sales_Model_Order */
$page->setFillColor(new Zend_Pdf_Color_GrayScale(1)); // <-- White header
$page->drawRectangle(25, 790, 570, 755);
$page->setFillColor(new Zend_Pdf_Color_GrayScale(0)); // <-- Black text
$this->_setFontRegular($page);
if ($putOrderId) {
$page->drawText(Mage::helper('sales')->__('Order # ').$order->getRealOrderId(), 35, 770, 'UTF-8');
}
$page->drawText(Mage::helper('sales')->__('Order Date: ') . Mage::helper('core')->formatDate($order->getCreatedAtStoreDate(), 'medium', false), 35, 760, 'UTF-8');
Additional information (discovered when making this change):
Be aware that the Creditmemo, Invoice, and shipment all share the same basic header from the Abstract file. So when you change the background color of the abstract file there is a line containing the Shipment #, Invoice # or Credit Memo # that is printed in each of the following files that you will also need to address.
The default font color is white and so changing the abstrat background header to white creates a white on white (hence invisible) result.
In the Creditmemo.php, Invoice.php, and Shipment.php files in that same directory find the following line (almost identical across the 3 files) and update it as well.
public function getPdf($shipments = array())
{
// .... a few lines of code ..... //
/* Add head */
$this->insertOrder($page, $shipment, Mage::getStoreConfigFlag(self::XML_PATH_SALES_PDF_SHIPMENT_PUT_ORDER_ID, $order->getStoreId()));
// 0 to print black, 1 to print white
$page->setFillColor(new Zend_Pdf_Color_GrayScale(1));
$this->_setFontRegular($page);