Re: scape codes to printer

From: Peter Below (TeamB) (100113.1101_at_compuXXserve.com)
Date: 01/23/04


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


Relevant Pages

  • Re: Font printing on Mainframe
    ... We use AFP for printing to z/OS printers from Windows. ... Otherwise there is a booklet "Font Summary for AFP Collection." ... understand how to print Arial on the Mainframe in 12pitch font. ...
    (bit.listserv.ibm-main)
  • Re: How to change the font in printing
    ... I am a newbie for using Outlook Express 6 in Windows ME, ... I want to default the font size in the printing. ... Outlook Express uses the same print engine as Internet Explorer. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Another Chinese font problem
    ... no actual bold font file installed, if it is printed to a PostScript ... Windows looks after font rendering to the screen and to the printer. ... So, when printing to this printer type, Windows sends the data and allows ...
    (microsoft.public.word.printingfonts)
  • How to change the font in printing
    ... I am a newbie for using Outlook Express 6 in Windows ME, ... I want to default the font size in the printing. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Determining Available Paper Sizes on Printer
    ... I looped through only the sizes given in the VB ... I'm afraid printing in Windows is still not an exact science, at least as far as paper sizes or special printing arrangements is concerned. ... Some printers are bristling with sensors that detect the size of paper in each available tray and some are not, and even for those that are there is still no "standard" way of communicating such information to Windows. ... Or in fact it could be that the printer driver you are using is a "generic for the model range" driver that can be used for various models in the range. ...
    (microsoft.public.vb.general.discussion)