[reportlab-users] How to make smaller PDF?

Craig Ringer reportlab-users@reportlab.com
Fri, 23 Jul 2004 15:02:01 +0800

On Fri, 2004-07-23 at 14:48, Bogdan M. Maryniuck wrote:
> Hello.
> I had generated PDF which contains ~1600 A4 pages. Its size is about ~100Mb.
> Usually, documentation from the Oracle with the same count of pages
> approximately takes up to 7-10Mb only. And, ironically, Oracle's PDF contains
> images, graphics and so on, but mine only a table grids. Well, I have to
> tell that I use Unicode TTF fonts support.

If you have Adobe Acrobat 6, you might want to run its space usage
report over the file and find out what's taking up all the space. It's
not too detailed, but can be very helpful.

PDFs I make here are ~24kb for the first page, and that includes a logo.
Subsequent pages are only a few kb each. If I use any custom PostScript
fonts, the size goes up massively (IIRC, about 700Kb for the first
page). It appears that ReportLab does not subset the embedded font, and
an entire PostScript font is not small so this would explain it.

If you're using a lot of non-standard fonts, they add up in a hurry.

Craig Ringer