[reportlab-users] RE: Emailing Corrupting reportlab PDFs follow up

Michael Porter reportlab-users@reportlab.com
Thu, 27 May 2004 13:16:53 +0100


I've done some investigation into this and it seems that Outlook is really
to blame here...

When you send a PDF attachment from Outlook with the default settings it
encodes the PDF as quoted-printable but doesn't explicitly encode the CRLF
(with a =0D=0A sequence). The receiving client will then presumably assume
that the line ending characters are unimportant and use those native to the
platform (which will result in a corrupt PDF on Unix or Macs).

So the problem is that Outlook is regarding the PDF as text rather than
binary. Outlook appears to ignore the mime-type/file extension when deciding
on what encoding to use but instead tries to guess from the file content.
Presumably the "random" element comes in because some PDFs look more
"binary" than others.

A workaround is to zip up the PDF or set Options|Mail
Format|Settings|Message Format to UUEncode.

The the real solution would be tell Outlook to always regard .PDF files as
binary (and hence use base64 encoding). Unfortunately I don't know how to do
this or even if it's possible. If anyone does, please let me know.


Michael Porter
ReportLab