[reportlab-users] Re: pdf's corrupted when emailed, possible solution included

Ulrich Schreiner reportlab-users@reportlab.com
Mon, 19 Apr 2004 08:11:57 +0200


i have the same problem. we generate our pdf on the server with 
reportlab and send it *immediatly* to the customer. but there are always 
some customers who complains that the pdf is corrupted!

i checked the pdf's and realized that the CRLF in the attachment are 
corrupted, so the pdf cannot be opened.

please notice: we do NOT use outlook here, we send the pdf direct on the 
server (with sendmail). so i think it is NOT outlook. the mime-type for 
the attachment is set correctly!

oh yes: i don't have any solution :-)


Jeff Johnson wrote:

> Tim Roberts wrote:
>> On Wed, 14 Apr 2004 11:28:38 -0400, Jeff Johnson <jjohnson@deg.cc> wrote:
>>> Hi, we're using reportlab 1.18 and since we've switched to a postfix 
>>> mail server on linux, our PDFs that are sent from Outlook are 
>>> corrupted.  This is apparently because Outlook uses quoted-printable 
>>> encoding instead of base64 to encode the PDF when it doesn't see 
>>> binary data in the first few lines of the attachment.
>> Even if this is true, I'm not sure what the problem is.  
>> Quoted-printable is quite capable of representing binary data.  A 
>> binary file grows more when encoded as QP than when encoded as base64, 
>> but it doesn't lose any information.  Where does the corruption occur?
> The problem is with the linefeeds.  When going from Windows to Unix, the 
> linefeeds _may_ be converted from CRLF to LF.  I'm no expert on the 
> issue but I think it was either vague or even explicitly allowed in the 
> qp specification that linefeeds can be converted to whatever the local 
> OS uses.  I've seen some posts that suggest quoted-printable should 
> _always_ use CRLF regardless of the OS.  Maybe that is now, or always 
> was, part of the quoted-printable spec.
> So far, the testing I've done from Outlook does not show any problems, 
> I'm still trying to reproduce the problem that was reported to me.
> Regards,
> Jeff
> _______________________________________________
> reportlab-users mailing list
> reportlab-users@reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users