This is the mail archive of the cygwin@sources.redhat.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Lp/lpr equiv or how do I print


Jason,

Thought I would expand a little on this from my own experience.  You may 
already know this but I thought I would throw it out just in case.

When I set up my a2ps I also created a symlink for lp in (/usr/local/bin 
- installed there by default) which was linked to a2ps which now gave me 
lp capability just like I would have in unix.  So instead of using a2ps I 
can use the command lp and works either as a command or as a pipe (as you 
might expect) by doing:

lp foo.txt
or 
cat foo.txt | lp

Since I installed GSView along with GSPrint the next thing I did was to 
try to get GSView working as a diplay printer.  To accomplish this I 
located the section in a2ps.cfg (in /usr/local/etc in the default 
install) which dealt with the display and ghostview.  It had several 
example variable lines but I added the following in that section:

Variable: ghostview /cygdrive/d/Aladdin/ghostgum/gsview/gsview32 
-dNOPLATFONTS

I also modified the line that defines the display printer so that it read 
as follows:

Printer: display | cat > #f0 && #{ghostview} `cygpath -w #f0`

Notice the use of cygpath - this was because the #f0 was a cygwin 
relative path and gsview32 wanted a wwindows style.

This now gave me the ability to do:

lp foo.txt -Pdisplay 

or to use a user option (which was already there) and display in color as 
follows:

lp foo.txt -=display   or lp foo.txt --user-option=display

I also still wanted the ability to select the printer and to this end I 
modified the line in your lp/lpr script for PCL printers which actually 
calls gsprint to read as follows:

"$GSPRINT" -printer "$2" -_ >$LOGFILE 2>&1

This gave me the option to now be able to enter:

lp -P"HP LaserJet 5Si Mopier"

and thus control what printer it went to.  However I got tired of trying 
to type the Printer name as it appears in Printers in Control Panel so I 
added these two lines to the printer configuration in a2ps-site.cfg:

Printer: fulton | #{lp} "HP LaserJet 5Si Mopier" #o
Printer: home | #{lp} "HP PhotoSmart P1000 Series" #o

These lines now give me the ability to do:

lp -Pfulton foo.txt
or 
lp -Phome foo.txt

depending on which printer I want it to go to.

Thought that if you hadn't already done this or didn't know about it - 
you might find it interesting.

Brian Keener
bkeener@thesoftwaresource.com




--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]