Jump to content

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

  • 0

How to reduce generated PDF file size


Today I came across new problem, my Carrier added an option where I have to upload the Invoice (proforma invoice) when creating shipping order.

However, the generated PDF from thirty bees is too big as they have maximum size limit.

Is there an option to make some override for the PDF output quality?


Thank you.


Share this post

Link to post
Share on other sites

2 answers to this question

Recommended Posts

  • 0

One of the reasons the pdf can be so huge is the used font. You can tweak used fonts in file classes/pdf/PDFGenerator.php, property $font_by_lang.

For example, deleting line 

'en' => 'dejavusans'

Can reduce pdf size from 461K to 15k.

Of course, the resulting pdf might look different. Or completely broken, if your language contains weird characters such as 'příliš žluťoučký kůň'

  • Thanks 1

Share this post

Link to post
Share on other sites
  • 0

Thank you for your quick answer.

As I already have override on that file due to encoding error for Slovenian language ( 'sl' => 'dejavusans',)

so I just made additional change for english language to helvetica ('en' => 'helvetica',)

and that reduced the english generated PDF from 501k to 45k.

Thank you quick solution, that was all I needed.


30 minutes ago, datakick said:

'příliš žluťoučký kůň

Didn't spot one yet 🙂


Edited by toplakd

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...