[reportlab-users] script conveting text to pdf

Dinu Gherman gherman at darwin.in-berlin.de
Wed Mar 14 12:58:59 EDT 2007


Paul Tremblay:


> I am thinking of posting this script on sourceforge, because I don't

> see any scripts that convert txt directly to PDF. The only script I

> see I have come across is one called txt2pdf.pl. Although the code is

> available, the script is shareware, not open source. Also, the script

> cannot handlt unicode; it is limited to a few encodings.


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...

Regards,

Dinu

--
Dinu C. Gherman
......................................................................
I love my Mac. I just wish it came in green! - www.greenmyapple.com



More information about the reportlab-users mailing list