3

I have a pdf which, when I duplicate it in Preview and save it, is substantially bigger afterwards:

Before:

$ pdfinfo manuscript-EditorComments.pdf
Title:
Subject:
Keywords:
Author:         Rainer M Krug
Creator:        LaTeX with hyperref package
Producer:       pdfTeX-1.40.14
CreationDate:   Fri Jan 24 13:59:56 2014
ModDate:        Fri Jan 24 13:59:56 2014
Tagged:         no
Form:           none
Pages:          39
Encrypted:      no
Page size:      612 x 792 pts (letter)
File size:      1715794 bytes  <<<<<<<<<<<<<<
Optimized:      no
PDF version:    1.5  <<<<<<<<<<<<<<

Afterwards:

$ pdfinfo manuscript-EditorComments\ copy.pdf
Author:         Rainer M Krug
Creator:        LaTeX with hyperref package
Producer:       Mac OS X 10.9.1 Quartz PDFContext
CreationDate:   Fri Jan 24 13:27:14 2014
ModDate:        Fri Jan 24 13:27:14 2014
Tagged:         no
Form:           none
Pages:          39
Encrypted:      no
Page size:      612 x 792 pts (letter)
File size:      2673770 bytes   <<<<<<<<<<<<<<
Optimized:      no
PDF version:    1.3   <<<<<<<<<<<<<<

I highlighted the relevant differences. Now is this only caused by the different pdf version?

Even reducing the size with the quartz filter does not change the file size:

$ pdfinfo manuscript-EditorComments\ copy\ reduced.pdf
Author:         Rainer M Krug
Creator:        LaTeX with hyperref package
Producer:       Mac OS X 10.9.1 Quartz PDFContext
CreationDate:   Fri Jan 24 13:35:43 2014
ModDate:        Fri Jan 24 13:35:43 2014
Tagged:         no
Form:           none
Pages:          39
Encrypted:      no
Page size:      612 x 792 pts (letter)
File size:      2428897 bytes   <<<<<<<<<<<<<<
Optimized:      no
PDF version:    1.3   <<<<<<<<<<<<<<

OK - no really heavy images in the pdf, but is the difference really only because of the pdf version?

3

The size difference of a few hundred kilobytes can be attributed to the PDF version and encoding.

Recent versions of PDF introduced features to reduce the file size. These features included compressed object streams in v1.4.

A PDF file can look identical but be stored on disk in nearly infinitely different forms. The application responsible for creating the PDF is critical to getting the smallest possible file size.

Most applications, such as Preview, will call out to a general purpose PDF framework or library to deal with the file format. This will result in well formed files with minimal effort by the application's developers.

Other applications may create PDFs highly-tuned to their content and needs. The PDF specification allows for creative reuse of content, de-duplication, and optimisations that require knowledge of the document's purpose and intention. This requires significant effort and is increasingly rare.

  • Thanks - that explains the discrepancies, but raises the question if pdflatex is so much more efficient, or if it is the different file formats. – Rainer Jan 25 '14 at 17:03
  • I would assume PDFLatex is more efficient because it is specialised in creating a limited and well known type of document. Preview, which defers to Apple's Quartz PDF engine, is highly generalised and has no insight into the content it is working with. – Graham Miln Jan 27 '14 at 9:57
0

When duplicating, Preview embeds all fonts to the pdf document which results in a larger file. A very useful feature if you need a simple way to embed all fonts.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .