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

Robin Becker reportlab-users@reportlab.com
Mon, 19 Apr 2004 15:23:35 +0100

Ulrich Schreiner wrote:

> hi,
> 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 :-)

..... You need to make sure that the mailer doesn't think that PDF is 
text. The only place I know where this is going to make a difference is 
a platform with 2 char line endings. Ensure all your opens have 'rb' for 
reading. If there's a mime type involved it should be one that doesn't 
involve text processing.
Robin Becker