Re: printing to a printer
- Posted by Derek Parnell <ddparnell at bigpond.com> Sep 25, 2004
- 482 views
Michelle Rogers wrote: > > Does anyone know if a library exists already to make things all beautiful > and stuff when you print to a printer? heh.....what I mean is ..ability to > change fonts, etc...maybe draw lines... If you are using Windows, then just treat the printer like you would a bitmap or window. For example, when using win32lib you can do this sort of thing...
include win32lib.ew without warning sequence prect sequence printparms integer lY printparms = getPrinter() prect = getRect(Printer) VOID = startDoc("My Report") VOID = startPage() setFont(Printer, "Arial", 24, Bold) setPenPos(Printer, 5, 5) wPuts(Printer, "Title Heading") lY = 5 + getTextHeight(Printer, "|") setPenColor(Printer, Black) setPenWidth(Printer, 20) drawLine(Printer, 0, lY, prect[3], lY) setFont(Printer, "Times New Roman", 12, Normal) setPenPos(Printer, 5, lY + 3) wPuts(Printer, "This is a test line.") VOID = endPage() VOID = endDoc()
-- Derek Parnell Melbourne, Australia