Unless you are the type of person who say, enjoys plunging your hand into chip fryer or poking yourself in the eye with knitting needles or watching the Star Wars prequels sober, you probably want to
steer clear of Magento.
But if you ARE that kind of person you may have been wondering about how to change the font sizes on your Magento PDF invoices.
Well the good news is that you can do it all pretty much in one file (if you arent shy about taking a short cut).
Here are two great resources to kick start.
http://www.magentocommerce.com/wiki/...an_invoice_pdf
http://www.magentocommerce.com/boards/viewthread/31533/
You'll need this file
/app/code/local/Mage/Sales/Model/Order/Pdf/Abstract.php
And anywhere that it says something like
Code:
$this->_setFontRegular($page);
then party down, because you can directly change the font size by
just tagging on a parameter like this:
Code:
$this->_setFontRegular($page, 8);
Keep in mind that I think these are
point sizes not font size per se.
You'll need a bit of trial and error to find the right size.
Other versions of Magento may vary but I found most of what I needed
on these lines:
line 232
line 252
line 278
line 286
line 325
line 331
Then, just to make it interesting, to change the Invoice Items section
you need to do a few different things. Other people have mentioned that
this file /app/code/local/Mage/Sales/Model/Order/Pdf/Items/Abstract.php
is where the action is at but I messed around with that and it didnt change a damned think. pfft.
Anyway to set the font for the header of the invoice items you need
to tackle these.
Code:
line 562 protected function _setFontRegular($object, $size = 8)
line 569 protected function _setFontBold($object, $size = 8)
line 576 protected function _setFontItalic($object, $size = 8)
set the
$size = parameter to whatever point size you want.
Next;
The list of items (the products that were bought) is controlled with this
Code:
line $fontSize = empty($column['font_size']) ? 9 : $column['font_size'];
change the value
after the question mark to your desired point size.
Finally;
For the subtotals, shipping and total, the font sizes are controlled in here
Code:
line 415
foreach ($total->getTotalsForDisplay() as $totalData) {
$lineBlock['lines'][] = array(
array(
'text' => $totalData['label'],
'feed' => 475,
'align' => 'right',
//'font_size' => $totalData['font_size'], hard coded in the font size for PDF invoice totals
'font_size' => 9,
'font' => 'bold'
),
array(
'text' => $totalData['amount'],
'feed' => 565,
'align' => 'right',
//'font_size' => $totalData['font_size'], hard coded in the font size for PDF invoice totals
'font_size' => 9,
'font' => 'bold'
),
);
}
In theory I think you are suppose to change something in the the Config XML file or such bollocks. But if are willing to go commando you can just hard code the point value as I did above. It works. I'm over it.
Hope that helps somebody. It's late and a glass of red wine and latest episode of Big Bang Theory are beckoning.