[reportlab-users] [PATCH] Optional use of A85 encoding

Yoann Roman yroman-reportlab at altalang.com
Mon Apr 12 13:39:26 EDT 2010

>> This is a follow-up to the following thread:

>> http://two.pairlist.net/pipermail/reportlab-users/2009-May/008239.html


>> Please find attached a patch that optionally disables the use of A85

>> encoding. By default, the option is set so that RL behaves exactly as

>> it does now. However, when the use of A85 encoding is disabled by

>> setting rl_config.useA85 to 0, streams aren't passed through that

>> encoding throughout the code. This resolves the issue I was having

>> with PDFs not being "binary enough" to trigger Outlook's base64

>> encoding, resulting in mangled PDFs by misbehaving MTAs.


>> [snip]


> I've put this in pretty much as is. I think I switched out some

> places where conditional expressions were used as they might be too

> modern for some.

Will make a note to avoid those in the future.

> The image caching was really all about a long time ago when it was

> useful to be able to create images in a85 format up front and then

> deploy to machines which might not have PIL etc etc. Also not sure

> about using the .bin extension (if that code ever gets used).

> Probably we ought to abandon the idea of using caching.

Entirely up to you. I used a different extension just to avoid getting
non-A85-encoded data pulled if someone was using image caching.

> It seems to run for me in both modes as well, but faster without a85.

I hadn't even benchmarked it, but that's a nice side benefit,
especially since we run all of our PDFs through multiBuild.

Thanks for including this!

Yoann Roman

More information about the reportlab-users mailing list