This is the mail archive of the 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]
Other format: [Raw text]

Re: printing from within Cygwin


Thanks for all the info! I'll review it all next week after the holiday.

I see you work at Watson labs,... do you by any chance know my brother
(David N. Smith) ???

Thanks again!


Igor Pechtchanski <> on 08/30/2002 05:59:39 PM

Please respond to

To:   Fred Smith/Computrition
Subject:  Re: printing from within Cygwin

On Fri, 30 Aug 2002 wrote:
> Trying to figure out how to print from a Cywin (console) app.
> Porting a Linux app to cygwin. On Linux it uses popen() to pipe output to
> shellscript which in turn cats its input to lpr (it may do other things,
> and may transform the data, but that's the ultimate goal).
> trying to figure out how to do something akin to that under cygwin.
> Invoking "lpr <filename>" at the command prompt comes back with an error
> message:
>      can't open 'prn' for writing.
> Advice would be appreciated. (I hope you're not going to tell me I need
> learn all about the innards of windoze printing!)
> Thanks!
> Fred
No, learning the innards of "windoze" printing is not necessary.  Learning
ghostscript options, however, wouldn't hurt. ;-)
I have been using the attached script for a while.  It works on my current
system (Win2k with gs7.03 installed).  Note the disabled support for
gsprint -- I couldn't get it to work properly.  If anyone can get the
gsprint part to work, please let me know.
I also had to tweak the standard that comes with ghostscript to
allow printing standard input properly (modified script attached).  My
copy of is in /usr/local/bin, and the script expects to find it
The -P option and the $PRINTER variable will recognize windows printer
names (spaces and all).  'ware of the backslashes...  Use the -Q option to
select the printer using the windows printer selection dialog.
      |\      _,,,---,,_
ZZZzz /,`.-'`'    -.  ;-;;,_
     |,4-  ) )-,_. ,\ (  `'-'      Igor Pechtchanski
    '---''(_/--'  `-'\_) fL   a.k.a JaguaR-R-R-r-r-r-.-.-.  Meow!
It took the computational power of three Commodore 64s to fly to the moon.
It takes a 486 to run Windows 95.  Something is wrong here. -- SC sig file

Attachment: lpr-mine
Description: Binary data

Description: Binary data

Unsubscribe info:
Bug reporting:

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