On Tue, 28 Sep 1999, Martijn Pieters wrote:
At 17:27 28/09/99 , Ping Lau wrote:
I like to first thank all of you for your suggestions. But I still can't quite figure out how PDF can solve my problem. The first problem I am facing is printing reports to pre printed forms loaded in dot matrix printers. The program has to drive the printer to print the info at the Well, this sound as if you want to print serverside: queue it with lpr at the right terminal ;) With dot matrix printers, you probably do not want to use graphical (postscript/pdf) mode, just print via the standard Ascii interface. (We do have such Unix applications, that do have an internal python MT2033 printer driver. Actually, it's general if you tell this thing how large the character cell is in the default font of the printer.)
With PDF you can position very precisely, and consistently across platforms. With it you can generate a printable document that would fit perfectly into your pre-printed form. You wll have to experiment a bit with the fonts and a dot-matrix printer though, to see what works best. Well, this might work for seldom used forms. dot matrix + bitmap printing == really slow.
As for barcodes: They are only lines of different widths. If you have the source of that Java class, you could reimplement it in Python, and, if they are part of the documents you are going to print with PDF, integrate that with your generated document. Both PDF libraries mentioned allow you to directly draw lines of a specified width, and import a GIF. Well, with python, there is the following (sick!) alternative: DISPLAY=vfbX:somenum import Tkinter Tkinter.Canvas -> can print postscript. ghostscript -> can convert postscript to pdf.
But then, at least generating ps is not the difficult, if you stick to text and lines. (Actually, text gets irritating if you want to include non Ascii(7bit) characters. Well, one gets quickly your own boilerplate code.) Andreas -- Andreas Kostyrka | andreas@mtg.co.at phone: +43/1/7070750 | phone: +43/676/4091256 MTG Handelsges.m.b.H. | fax: +43/1/7065299 Raiffeisenstr. 16/9 | 2320 Zwoelfaxing AUSTRIA