Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

When printing invoices (PDF) from Magento, the font is 7px... it's absolutely tiny, half my customers probably won't be able to read it, is there a way to make it 12+?

Thanks.

share|improve this question

3 Answers 3

up vote 1 down vote accepted

According to this entry on the magento message boards you need to edit these files:

/app/code/core/Mage/Sales/Model/Order/Pdf/Invoice.php 
/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php 
/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php

and change the second parameter, which is the font size, to the number you want on these methods:

_setFontRegular(), _setFontBold(), and _setFontItalic()
share|improve this answer
    
Yeah I found and tried that, the line spacing doesn't seem to also increase, so I'm left with overlapping text. :/ Any ideas? –  Anonymous Jun 16 '11 at 12:47
    
You may need to dive into the ZendFramework, as linked on that page, to try and change the line spacing. You will probably need to alter co-ordinates of blocks of text in any case. That page talks about decreasing y values. –  paulmorriss Jun 16 '11 at 13:36
    
This wiki page may be of use as well. Also, it may be easier to simply change the DPI resolution of the PDF. I don't know how this is done in Zend_PDF, but the font sizes are being specified in points, so a lower DPI would increase their relative size. –  Lèse majesté Apr 9 '12 at 15:43

It is in the files in /app/code/core/Mage/Sales/Model/Order/Pdf/ you need to change the different fonts.

But if you set the font or size, so the text becomes bigger you need to find all the places in the code where it says $this->y -=XX; (most xx=10) and change all these places to a higher number if you change the fontsize.

Another way is to use my extension, where you can make all the pdf's from HTML.

See a connect here: magentocommerce.com/magento-connect/html2pdf-6040.html

share|improve this answer

You'll need to add on some numbers where it has $this->y. I also have a newly-updated extension which creates great-looking PDFs that you can fully customize.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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