[reportlab-users] script conveting text to pdf

phthenry at iglou.com phthenry at iglou.com
Wed Mar 14 13:54:39 EDT 2007

-----Original Message-----
From: Dinu Gherman <gherman at darwin.in-berlin.de>
To: Support list for users of Reportlab software <reportlab-
users at reportlab.com>
Date: Wed, 14 Mar 2007 17:58:59 +0100
Subject: Re: [reportlab-users] script conveting text to pdf


> Have you seen py2pdf, which I wrote a long time ago? It's in

> reportlab/tools/py2pdf. It also handles simple ASCII files, but

> does not handle Unicode or any other encoding. Also, there is

> no underlining/superscript... You can call it like this:


> py2pdf.py --help

> py2pdf.py file.py

> py2pdf.py --input=ascii file.txt


> The code is rather complex since it does a lot of stuff without

> using Platypus (I reserved the rewrite for another life). But

> Unicode support would be rather simple to add, I hope...


I am at work now and cannot look at your script.

However, I noticed that unicode is automatic with Canvas.
I tried a few files with UTF-8 and the characters printed fine.
When I used files with latin1 encoding, the script raised a
UnicodeError exception, or something simliar. I had to change
the lines from latin1 to utf8. The automatic support for
unicode is very nice.


More information about the reportlab-users mailing list