aeroo / aeroo_docs

Aeroo DOCS - a document conversion service
GNU General Public License v3.0
10 stars 29 forks source link

PDF output size bloated? #19

Open RaffaeleT opened 8 years ago

RaffaeleT commented 8 years ago

Hallo I'm running aeroodocs with Odoo v8 on Ubuntu 14.04. I'm experiencing a huge growth of PDF outputs size. This is the simplest test I did:

  1. I created a 3-pages template containing only page breaks (no text body), with header and footer containing images
  2. I printed it (eg. as an invoice) as PDF: the size is 38.5KB
  3. I added a Lorem Ipsum line of text in each page in the original template
  4. I printed it as PDF: the size is 132KB
  5. I printed the "Lorem Ipsum" template as DOC
  6. Using LibreOffice application, I manually saved the doc as a PDF: the size is 50.6KB

Summarizing: A 3-page document with header and footer containing images:

  1. if it contains no text in the body, is sized 38.5 KB - when printed with aeroodocs
  2. if it contains a line of text in each page, is sized 132 KB - when printed with aeroodocs
  3. if it is saved from within LibreOffice, is sized 50.6 KB

In real-word example, these are the sizes of a 1-page invoice with 3 tables in it:

  1. 422KB when printed as PDF
  2. 36.5KB when printed as DOC
  3. 130KB when the DOC is exported as PDF manually from LibreOffice

Any idea about where I should investigate on?

RaffaeleT commented 8 years ago

I noticed that the document used different fonts, and typographical emphasis (bold, italic, etc). These are the optimization I gained:

  1. using Times New Roman only = 220KB
  2. striping off bolds and italics = 142KB

Still, it is larger than the document exported as PDF from LibreOffice, which is 98KB.

sraps commented 8 years ago

I will give it a look. If it's true, it'd indeed adding up in space on thousands of documents...

RaffaeleT commented 8 years ago

I solved by installing Microsoft TTF fonts. Sorry, I didn't know they were missing by default from the system. The PDF output now is 72.5KB