[reportlab-users] print on non-text-capable printers from DOS software

Luc Saffre reportlab-users@reportlab.com
Tue, 12 Nov 2002 08:57:12 +0200


  I wrote a little tool which converts a text file containing Epson LQ 
control characters into a PDF file.
Because I am maintaining a DOS accounting application. The DOS 
application thinks that it is printing to an Epson LQ printer, but the 
printer output is redirected to a file, and then I run prn2pdf.py to 
create a PDF file and run Acrobat Reader.

The two possible applications of this system are
(1) use a non-text-capable printer to print accounting reports from a 
text-only DOS application
(2) store big listings on a CD-ROM instead of printing them out
prn2pdf.pyjust checks for LQ control sequences and translates them, 
converts the encoding of remaining text from codepage 437 to latin-1, 
then renders the text using the standard Courier font which is the only 
monospaced standard font in PDF files.

source code of prn2pdf.py at
http://my.tele2.ee/lsaffre/comp/prn2pdf.htm

Thanks to the Reportlab team for their work and to the Reportlab 
managers for deciding to make it GPL.
Luc Saffre