PDF Generation in Magento is Really slow
-
12-12-2019 - |
Question
I have a problem with my Magento installation, at the hour of print the PDF with the invoices and packing Slips it is really slow, around 3-4 minutes in give the file in PDF.
No matter if u print 1 page or more, the time of the print is the same.
Solution
Have you tried changing the default fontfor PDF generation? This only effects the file-size, but it is such a significant reduction in size it may improve things for you.
copy the core file into local (local override)
app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php
to
app/code/local/Mage/Sales/Model/Order/Pdf/Abstract.php
Find the line which contains:
$font = Zend_Pdf_Font::fontWithPath(Mage::getBaseDir() . ‘/lib/LinLibertineFont/LinLibertineC_Re-2.8.0.ttf’);
replace with:
$font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);
In my case the original file size was near 1mb, afterwards it was 200K.
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange