[comp.lang.postscript] What kind of printer am i

buck@nrl-cmf.UUCP (Loren Buchanan) (02/05/91)

In article <PHILIP.91Feb4175114@beeblebrox.dle.dg.com> 
philip@beeblebrox.dle.dg.com (Philip Gladstone) writes:
>Can anybody tell me how you tell if colour is available on the printer
>at print time?
>

systemdict /colorimage known {color code} {B&W code} ifelse

Now for something a bit different, how do I tell what kind of printer am
I on?  I am hoping for something that will at least tell me the model,
the current paper size (sizes if more than one tray), etc.

Specific questions I have right now is how do I tell if I am on a printer,
or under one of the programs that displays PostScript on a computer 
screen (i.e. NeWS, Display PostScript, or whatever).  I also need to be
able to tell the difference between a QMS ColorScript and a Tektronix
Phaser PX.  I use the above test to determine if I am on a color or
B&W device, but this isn't always correct.  

NeWS does not have the colorimage operator, but it allows 24 as the bit 
depth for the image operator.  What NeWS does not support is 3, 6, or 12 
bit color (the equivalent of 1, 2, or 4 bit B&W).  I suppose I will write
a conversion of a 3, 6, or 12 bit image string to a 24 bit so I can
preview reduced bit image files on NeWS.  Does anybody have any knowledge
of how Display PostScript handles color images (I haven't got TFM to read
for our Display PostScript machine).

In regards to paper size, the Printronix Phaser PX that we have thinks 
that it is a tabloid (11x17 inch) size printer.  It only supports letter
(8.5x11 inch) and legal (8.5x14 inch) paper.  It only has a single paper
tray which may be set to hold either letter or legal paper.  How can I
tell which size paper it holds?  How do I tell what size paper is loaded
in my QMS ColorScript 100?  The following code (adapted from the Green
book) only tests for knowledge of the the routines to change to particular
paper trays:

%%BeginPaperSize: Ledger
statusdict /ledgertray known { %if
  statusdict begin
    ledgertray
  end
}{ %else
  statusdict /legaltray known { %if
    statusdict begin
      legaltray
      /maxwidth 7 inch def
      /maxheight 12.5 inch def
    end
  }{ %else
    /maxwidth 7 inch def
    /maxheight 9.5 inch def
  } ifelse % legal test
} ifelse % ledger test
%%EndPaperSize

But the real world doesn't work that way.  Most PostScript printers only
have a single paper tray that may hold either letter or legal paper.  I
would like to be able to test for what paper size the printer has loaded
and is ready to print on, as well as test to see if other sizes are
available.

The way I have my code structured is that failing color and paper size
tests it will assume that the output will be B&W on letter sized paper.

Thanks for any advice, help, or flaming arrows sent to the various
PostScript implementors (flaming arrows sent to me will be redirected
to /dev/null/saddam).

B Cing U

Buck