6

What do I need to do in order to produce PDF invoices with a file size smaller than 20kb?

Example PDF

I create invoices for a small business and I have 60,000+ invoices stored as PDFs (non scanned) that are about 108kb per page on average. I generate these invoices from an Excel spreadsheet and save them as PDFs. I've noticed documents from other companies, or even my own bank statement as PDFs that are less than 20kb per page on average.

(UPDATED 3/17) I've used the Acrobat Audit tool (accessible in the "Save as" window when selecting "Optimized PDF" from the drop-down and then clicking the settings button, on Acrobat XI). Here is the result:

    Content Streams    3.48145 KB
    Fonts             91.98340 KB
    Structure Info    11.72852 KB
    Document Overhead  0.64453 KB
    -----------------------------
    TOTAL             107.8379 KB

What I've tried:

  • I attempted to use Acrobat XI's "Optimize Scanned PDF" settings, but I get "Page contains renderable text."
  • I attempted to "Save as" choosing the file type of "Adobe PDF Files, Optimized (*.pdf)". The results were slightly smaller, but not less than 20kb or even less than 90kb.
  • I've tried Web apps that have about the same effect as the aforementioned "Save as" attempt.
  • Bank statements etc. use scripts to generate the PDFs and it only creates what is needed on the document. I.e. no additional artefacts or metadata. I use FPDF with PHP and it creates tiny files that contain many pages. Using Microsoft Office and "scanned" documents, I would think, would have a fair few additional bits of data that, inevitably, might bloat the file. – Kinnectus Mar 14 '15 at 21:08
  • Do your PDFs have embedded fonts and color profile? If so, removing those could cut out like 30 KB – Cole Johnson Mar 15 '15 at 2:04
  • Analyze what causes your pdf's to be this big. This SU question covers that part. Next, you should see if your existing tools have options to leave those space consuming objects out. If that fails, you can switch to other tools as mentioned in the answers. Just jumping to another tool won't give you the real insight of what's going on. – agtoever Mar 15 '15 at 5:16
  • unor removing the hyperlink did not improve the quality of the question – Xzila Mar 25 '15 at 15:53
4

From the result of Acrobat Audit tool, the biggest part of your PDF is due to Fonts inclusion (91kb) , not to real PDF content (3kb+11kb).

So you can try some of the following:

  • use a single font for the whole document
  • while using a single font, try out different fonts to see which on give you the smallest size (I've had the same problem years ago, bay using different font the document size varied wildly from 13kb to 150kb)
  • some software that generate PDF have an option to include only the used characters of a font, instead of the whole font character set, maybe this could reduce the file size a bit (PDF Creator comes to mind)
  • some software that generate PDF have an option to render the text as vector graphics, so it wont need to include the fonts. If the text contents of the PDF is small, this could reduce the file size (I've seen this options somewhere, but I can't remind in which software...)
  • 1
    It's been several years, but I'd like to supplement this answer with testimony. This indeed helped me reduce the file sizes. The default Windows font is currently Calibri and is a much larger font size than Arial. By Switching to Arial the file sizes dropped considerably. – Xzila Aug 6 '18 at 19:07
2

Such a small size is most likely due to an improper PDF (considering the kind of document you describe). Improper means that it is a valid PDF, but won't pass any compliance checks. Now, as these documents are invoices, you may have to have a careful look at what is needed; you may have to create PDF/A compliant documents, and for that you'd have to use a tool which makes them.

Things to make a PDF smaller: You can limit your fonts to one (that's what most bank statements have), unembed all fonts, for example (and with that step, your PDF will become small, but improper). If you have logos, make sure you have a vector version, or even make a logo font (which you will have to embed and subset, of course). You may also get rid of all metadata etc.

You might use Acrobat again, and carefully look at the save as optimized dialog options.

Another option might be to use OpenOffice for the PDF production; it appears to me that the files may be a bit smaller (the invoices I send out are without any tweaking about 50 kB).

1

You may want to use PDFCreator to create PDFs with smaller sizes. It's a free and handy PDF converter tool.

After installing PDFCreator, open your Excel file and select Print, and then select PDFCreator as the printer. In a few seconds, it will convert your invoice to PDF format. Check your PDF file size and please drop a line here about the result. Good luck.

1

You could create the PDF using PHP write commands. I just did a quick search for PHP PDF and came up with several ways to produce pdfs. such as...

"TCPDF is a PHP class for generating PDF documents without requiring external extensions. TCPDF Supports UTF-8, Unicode, RTL languages, XHTML, Javascript, digital signatures, barcodes and much more."

Its been a while but i got involved in web based document creation and i remember the pdf's produced were remarkably small.

1

I found a web site that will compress you files for you on-line.

Had an 180mb file and it took down to 456k.

Here's the site: Compress PDF

Give it try.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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