I realize I forgot to address one of your points: what does pdf.Save(true) do?
I checked with our lead architect and he explained the various optimizations that take place when specifying true:
- PDF is linearized (for fast web-view)
- Unreferenced resources are removed (unlikely to occur with a freshly created PDF file, but more likely if the PDF has been modified a few times)
- ASCII85, LZW and unencoded streams are converted to Flate-encoded streams (results in smaller files, especially when using large areas of color or repeating patterns)
- Fonts and encodings are merged when possible
- XObjects (i.e. elements that are used multiple times throughout the file) are merged to remove duplicates (which may occur when copying pages from one PDF to another).
If your PDF is already pretty much optimized, using pdf.save(true) will have little effect. But the more you make changes to existing PDFs, the more likely that optimizing it results in a smaller, more efficient file. As a general rule of thumb, you should always optimize when saving since the operation has little impact on overall performance and may help control the size of the resulting PDF.