[reportlab-users] RE: PageCompression not working???

Andy Robinson reportlab-users@reportlab.com
Fri, 15 Nov 2002 01:05:15 -0000


> I am generating a rather large (2 sided 11" x 17") document.  
> It contains a number of tables, barcharts, etc.  What I don't
> understand is why does the created .PDF get larger when
> I turn compression on than when it is off?  The size of the
> file goes from 180K to 210K when I turn compression on.

I may not have time to look in them until the weekend,
it's 1 am and I have to get to bed.  But in general compressing
anything which is already compressed can make it bigger.
You have various bitmaps in there.  If you are using 
drawInlineImage for your bitmaps, they will be double-
compressed which makes things worse.  If you can
switch to using drawImage, they will be outside the
page stream and not get double-compressed.

Simple test: comment out all bitmap images and try with
compression on and off.  Then it should do as expected.

Compression is a big win if you have tons of text
and vector art, but it's on by default anyway and I
don't expect you will be able to make these much smaller.
210kb is not bad for so much detail.

- Andy