[reportlab-users] When it is safe to use PDFZCompress in reportlab code

Robin Becker reportlab-users@reportlab.com
Thu, 23 May 2002 15:02:59 +0100

In article <20020523115353.GA31616@codeworks.lt>, Marius Gedminas
<marius@codeworks.lt> writes
>Currently reportlab does not compress embedded Type1 font files (see
>reportlab.pdfbase.pdfmetrics.EmbeddedType1Face.addObjects).  Actually
>the code contains a line enabling PDFZCompress filter, but that line is
>commented out.  What is the reason for that?
>My TTF embedding code currently also contains a commented out line that
>would enable compression if uncommented.  Since PDF file size was a
>concern during earlier discussions about TTF embedding, I would like to
>enable compression by default, but I'm not sure it is safe.
>Unfortunatelly, there's no way (or at least I couldn't find one) to get
>to the pageCompression argument passed to Canvas in font embedding code.
>I am now thinking about adding an equivalent attribute to PDFDocument,
>that would be passed from Canvas and could be checked in fonts'
>addObjects methods.  Or should I just turn compression unconditionally?
>Marius Gedminas
Well I guess you could have a quick go with the compression forced on
locall. If it works then think about how to turn it on/off. I'm not the
expert here. In the 1.3 spec  I see only flate/lzw and no mention of Z
(or is that lzw?). PDFZCompress stuff appears to be using zlib and I
thought that zlib wasn't lzw? IE gzip != compress in uniz terms.
Robin Becker