sending created pdfs by email from within a python script

50 views
Skip to first unread message

Thomas Frick

unread,
Apr 24, 2012, 5:46:14 PM4/24/12
to Pisa XHTML2PDF Support
Converting html to pdf works just fine (which is extremely useful for
me).

When I attach the pdf to an email using thunderbird, it arrives
intact.

But when I send the pdf from within a python script (using available
email modules), the file arrives corrupted. Looking at it as plain
text, the very end is truncated.

It may have to do with international letters, as replacing the missing
part makes the pdf readable again, but leaves the "äs", "ös" and "üs"
blank.

I am using python 2.5.2, pisa 3.0.33, html5lib-0.95, reportlab-
daily.win32-py2.5 and the email module enclosed with python.

If anybody has a suggestion, I'd be very greatful

Thomas

Thomas Frick

unread,
Apr 26, 2012, 1:55:23 AM4/26/12
to Pisa XHTML2PDF Support
April 26th, 2012

Problem solved:

Writing the pdf to the harddisk is not finished before the email
script reads it from the harddisk, thus, the pdf is incomplete.
Separating the two steps solves the issue.
Reply all
Reply to author
Forward
0 new messages