from lino.textprinter import winprn printerName = None # Default Printer d = winprn.Win32PrinterDocument(printerName) d.printLine("") d.printLine("Win32PrinterDocument Test page") d.printLine("") cols = 7 d.printLine("".join(" "*9+str(i+1) for i in range(cols)])) d.printLine("1234567890"*cols) d.printLine("") d.printLine("Here is some \003b1bold\033b0 text.") d.printLine("Here is some \033u1underlined\033u0 text.") d.printLine("Here is some \033i1italic\033i0 text.") d.endDoc()
The printed output of this code will look roughly as follows:
Win32PrinterDocument Test page
1 2 3 4 5 6 7 1234567890123456789012345678901234567890123456789012345678901234567890
Here is some bold text. Here is some underlined text. Here is some italic text.
Refering articles:
- new textprinter example (code changes 21.01.05) — New textprinter1.py example. Rather for fun or to be complete I added a console version of a textprinter. The old Example is now obsolete.
- new textprinter: htmlprn (code changes 03.01.05) — New module lino:src/lino/textprinter/htmlprn.py. Tested in lino:tests/75.py and used only to generate the html version for Example : Win32PrinterDocument Test page.