Consider this sample code:
\documentclass{article}
\usepackage{lipsum}
\begin{document}
\lipsum[1-4]
\end{document}
When I compile this with latex
and then use dvipdfm
, the output file is 7893 bytes. When I use pdflatex
, the output PDF is a whopping 20696 bytes. Naturally, the outputs are visually indistinguishable one from another.
Why does this happen? What does pdflatex
put in there that takes so much space?
For reference, I have used the latest MikTeX 2.9 on Windows 7, and ran the commands without any extra switches.
Best Answer
Martin Heller has stated the correct answer:
dvipdfm
uses a different font format thanpdftex
. You can look into the PDF file by loading it into a text editor. Sometimes (well, often), the objects are compressed and you only see some data. So you either need a decompression algorithm built into your head, or use a tool like qpdf to uncompress the objects (that is what I do):Now the output file is much more readable and you can now compare the output of
dvipdfm
andpdftex
. I don't know if this applies to all cases, but in this example you can take a look at the font object:and
Both have different entries referring to the font file (
/FontFile3
and/FontFile
). According to the table 126 "Embedded font organization for various font types" in the PDF specification, the entry/FontFile
refers to a Type1 font program and/FontFile3
to whatever the subtype in the referred stream is. So we need to take a look at object #11 in thedvipdfm
file:So it is
Type1C
, which is according to the same table in the PDF spec: "Type 1–equivalent font program represented in the Compact Font Format (CFF), as described in Adobe Technical Note #5176, The Compact Font Format Specification."To find out what the secret of CFF is, a look at the introduction of "The Compact Font Format Specification" suffices: