title: splitting and rejoining PDFs with Poppler results in larger file? (despite stripping metadata)
body: <p>If I have a multi page PDF, and split it into separate pages using the excellent <a href="https://poppler.freedesktop.org/" rel="nofollow noreferrer">poppler package</a> (installed on macOS using <code>brew install poppler</code>) like this:</p>
  
  <p><code>pdfseparate foo.pdf bar-%04d.pdf</code></p>
  
  <p>and then rejoin the resulting bar-####.pdf files, like so:</p>
  
  <p><code>pdfunite bar-*.pdf baz.pdf</code></p>
  
  <p>The resulting baz.pdf appears to have the same content, but <strong>the file is much larger</strong>.</p>
  
  <p>At first I assumed because there would be duplicate metadata in the result or something. But even if I strip all metadata from all files, i.e. from the input, as well as the intermediate bar-####.pdf files, as well as the resulting output file, using <a href="https://www.sno.phy.queensu.ca/~phil/exiftool/index.html" rel="nofollow noreferrer">exiftool</a> and <a href="http://qpdf.sourceforge.net/" rel="nofollow noreferrer">qpdf</a> like this:</p>
  
  <pre><code># command line steps to strip metadata from (and re-linearize) example.pdf :
  exiftool -all= -overwrite_original example.pdf ;
  mv example.pdf temp.pdf ;
  qpdf --linearize temp.pdf example.pdf
  </code></pre>
  
  <p>Then <em>still</em> the resulting baz.pdf file is much larger than the original input.</p>
  
  <p>What can be the cause of this? What else can there be in a multiple-page PDF file other than it's bare contents? Assuming that poppler's <code>pdfseparate</code> and <code>pdfunite</code> leave the actual content itself untouched, and that my stripping of metadata is correct.</p>
  
  <p>Or is it possible that <code>pdfseparate</code> and <code>pdfunite</code> somehow decompose and reconstruct the PDF contents in a way that is lossless but sub-optimal? (I don't know enough about the inner structure of PDF files but I can imagine there are a lot of different ways to encode the same content)</p>
  
  <p>By the way if I inspect any of the involved PDF files using <code>exiftool somefile.pdf</code> it does indeed show no metadata at all (and Linearized: Yes).</p>