What is my printer name?

Hi,

I want to print a Postscript file. I read in the Ghostscript documentation that I can use the command:

gs -sDEVICE=*devicename* myfile.ps

But what is my devicename?

In the manual, it says that I can check the available devices with “devicenames ==”. This gives a long list of names, none of which I recognise as my local device.

Additional, if I use ghostview to view myfile.ps, I can successfully print it by selecting that option from the menu. The strange thing is that whatever I put in the printer name field (or even leave blank as it is not pre-populated with a drop-down list), it prints to my local printer.

How does GhostView know what/where/which printer I have? What is the mapping/aliasing between Ghostscript and my local postscript printer?

Regards, Martin

Using openSUSE 11.3 and CUPS, I can run the following program and find the names of my printer queues. (Alt-F2 and paste the following command)

desktop-launch http://localhost:631/

Select the **Administration Tab **Then select Manage Printers button and I see the queue names for all installed printers. This launches Firefox, but you can just press the following link http://localhost:631/ if you want while running Firefox.

Thank You,

On 2011-01-02 21:36, martinprowe wrote:
>
> Hi,
>
> I want to print a Postscript file.

Simply use “lp myfile.ps”. That’s all. Other alternatives are “lpr”. To get
the list of printers, use “lpstat -a”. Or look into <hhtp://localhost:631>


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

Once you have done lpstat -a like this to list all printers:


# lpstat -a
HPDeskJet880C accepting requests since Mon 03 Jan 2011 04:08:26 AM NZDT

You can print to that device like this using the ‘-d’ argument:


lp -d HPDeskJet880C myfile.ps

On 2011-01-02 22:36, ah7013 wrote:

> lp -d HPDeskJet880C myfile.ps
>
> --------------------

If you have only one printer defined, you should set that one as default.
Then you don’t have to specify it with -d.


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)

Thanks for tip. Done :slight_smile:

Thank you Guys,

That info has got me moving again.

I guess that fact that it was printing without a “named” device was due to the fact that I had defined the postscript printer as my default?

Regards, Martin

I guess that fact that it was printing without a “named” device was due to the fact that I had defined the postscript printer as my default?
I think that depends on what application you are trying to print from. Using terminal commands to print is less user friendly than printing from some GUI. So, what was the name of your printer?

Thank You,

To me, it is a Xerox Phaser 8560 with a network address of 192.168.1.200:9100. But to CUPS, the queue name is just “phaser”.

Now, using lp -d phaser myfile.ps is just fine.
But not for Ghostscript? The command gs -sDEVICE=phaser myfile.ps give me “unknown device”?

Not to worry, lp is just fine for my current needs.

Regards, Martin

On 2011-01-03 21:06, martinprowe wrote:

> Now, using lp -d phaser myfile.ps is just fine.
> But not for Ghostscript? The command gs -sDEVICE=phaser myfile.ps
> give me “unknown device”?

I have never printed from ghostscript, so I don’t know. However, cups may
use ghostscript as a filter during the print processing.

Have you read the man page? The device is the “driver”, like “epson” for a
9 pin printer. And the output goes to the screen by default, not to the
real printer.

> Ghostscript may be built to use many different output devices. To see which devices your executable includes, run
> “gs -h”. Unless you specify a particular device, Ghostscript normally opens the first one of those and directs out-
> put to it, so if the first one in the list is the one you want to use, just issue the command

And “gs -h” displays the available devices:

> Available devices:
> alc1900 alc2000 alc4000 alc4100 alc8500 alc8600 alc9100 ap3250 appledmp
> atx23 atx24 atx38 bbox bff bit bitcmyk bitrgb bitrgbtags bj10e bj10v
> bj10vh bj200 bjc600 bjc800 bjc880j bjccmyk bjccolor bjcgray bjcmono bmp16
> bmp16m bmp256 bmp32b bmpgray bmpmono bmpsep1 bmpsep8 ccr cdeskjet cdj1600
> cdj500 cdj550 cdj670 cdj850 cdj880 cdj890 cdj970 cdjcolor cdjmono cfax
> cgm24 cgm8 cgmmono chp2200 cif cljet5 cljet5c cljet5pr coslw2p coslwxl
> cp50 cups declj250 deskjet devicen dfaxhigh dfaxlow display dj505j

:smiley:


Cheers / Saludos,

Carlos E. R.
(from 11.2 x86_64 “Emerald” at Telcontar)