Re: scape codes to printer
From: Peter Below (TeamB) (100113.1101_at_compuXXserve.com)
Date: 01/23/04
- Next message: Peter Below (TeamB): "Re: Office .doc format"
- Previous message: Peter Below (TeamB): "Re: Horizontal Scroll for CheckListBox"
- In reply to: Felix González: "scape codes to printer"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 23 Jan 2004 19:43:04 +0100
In article <4011067c@newsgroups.borland.com>, Felix González wrote:
> I need to send scape codes to a printer, but I can´t use the port
> (LPT1......) I´m using Terminal Server and the printer it´s on a client of
> Terminal Server (I can´t use a VPN and net use..), I need to use the
> TPrinter.
>
<quote
source="http://codecentral.borland.com/codecentral/ccweb.exe/listing?id=1937
4">
On printing in Windows
In Windows you have two official ways to print. The first is
printer-independent. You use the Printer object and its Canvas, you set
the printer.canvas.font to select fonts, print bold, italics, underline,
and so on. You usually cannot select a specific printer font unless the
font has been installed with the printer driver. So text may end up
being printed as graphics. But at least your printing code will work
whatever printer model the customer has attached.
The second method bypasses the printer driver to send "raw" output to
the printer. This is very similar to how we used to do printing on DOS,
it is completely printer dependent, since all printer commands
(including those for font selection) have to be included within the text
you send to the printer. Character translations from the Windows ANSI
codepage to whatever the printer uses as encoding has to be done
manually. Printing graphics is a major undertaking.
This is done using the WinSpool.WritePrinter function. The job still
goes through the Windows print spooler. Search the newsgroup archives
for keywords like PrtRaw, PrintLineToGeneric, PrintfileToGeneric. That
will turn up examples.
There is also a kind of compromise between these two methods of
printing. YOu can use the first method and include printer commands (in
fact any kind of raw data) using the Escape API function with the
PASSTHROUGH flag. This is something discouraged by MS and mainly there
for backwards compatibility. It may go away in the future, and printer
drivers are not required to implement PASSTHROUGH, as far as i know
(though most do). You can search the archives to find examples for this,
too.
</quote>
-- Peter Below (TeamB) Use the newsgroup archives : http://www.mers.com/searchsite.html http://www.tamaracka.com/search.htm http://groups.google.com http://www.prolix.be
- Next message: Peter Below (TeamB): "Re: Office .doc format"
- Previous message: Peter Below (TeamB): "Re: Horizontal Scroll for CheckListBox"
- In reply to: Felix González: "scape codes to printer"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|