public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Re: lpr works? FAQ in error?
@ 2008-07-18  9:08 Rodrigo Medina
  0 siblings, 0 replies; 10+ messages in thread
From: Rodrigo Medina @ 2008-07-18  9:08 UTC (permalink / raw)
  To: cygwin

Lou Umscheid wrote 
>As a follow-up and clarification to my previous post, what I would like 
>to be able to do is to pipe output to a printer, e.g.
> ls -l | lpr
>This doesn't work for me as I explained previously. Using notepad /P 
>instead of lpr doesn't work either. Is there a simple way to do this?

The problem with lpr is that it sends the file as it is to the printer, and
modern printers require some kind of translation of the file to their own
special language. You can send a text file to the printer using the
windows program NOTEPAD /P
For runnig notepad from a cygwin terminal you can use the command
cygstart. For example
cygstar notepad file.txt
opens file.txt in notepad.
cygstart notepad /P file.txt
sends file.txt to the printer.
The are 2 additional problems. Notepad prints Windows text files, with
the CRLF line endings. If your file is a unix text file with LF endings you
need
first to pass the file through the unix2dos filter that is part of the
cygutils.
The other problem is that Notepad does not know about cygwin pipes,
but you can make a bash script that passes the pipe input through the
unix2dos filter, writes the result in a temporal file, prints the file with
NOTEPAD /P and deletes the temporal file.

RM


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread
* RE:lpr works? FAQ in error?
@ 2008-05-09  8:44 Rodrigo Medina
  2008-07-17 22:19 ` lpr " Lou Umscheid
  0 siblings, 1 reply; 10+ messages in thread
From: Rodrigo Medina @ 2008-05-09  8:44 UTC (permalink / raw)
  To: cygwin

Lee D. Rothstein on Fri, 09 May 2008 01:26:09 -0400 wrote:
>I've gotten /usr/bin/lpr to work under Vista. So is the FAQ in error?

It is in error. There is a working lpr which is part or cygutils. See man
pages.

> My problem is finding a filter for Epson printers.

For modern Epson printers you may use the IJS drive of ghostscript
You have to;
1- Install ghostscript 
2- Install gutenprint and foomatic
there few problems. See:
http://sourceware.org/ml/cygwin/2006-05/msg00566.html
and
http://sourceware.org/ml/cygwin/2006-05/msg00575.html

An easier way is to used the Windows drivers. You need a Windows program
that could print.
You may use  "NOTEPAD /P" for text files and "Foxit Reader /p" for PDF files
You can use ghostscript for transforming ps files into PDF files
Foxit Reader is a faster than Acrobat Reader and has the convenient switch
"/p" for printing.

For example I use the following script (lprps) for printing postscript
files:

#!/bin/bash
## Para mandar un archivo PostScript a la impresora
## convirtiendolo en PDF y escribiendolo con Foxit
FRDIR="/cygdrive/c/Program Files/Foxit Software/Foxit Reader/Foxit
Reader.exe"
gs -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pdfwrite -dCompatibilityLevel=1.4
 -sOutputFile=/tmp/~lprps.pdf $1 ;
FDIR=`cygpath -wa /tmp/~lprps.pdf`
cygstart "$FRDIR" /p $FDIR
exit 0

The command
$ lprps FILE.ps
prints FILE.ps

I hope that this can be useful 
R.M.





--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread
* lpr works? FAQ in error?
@ 2008-05-09  7:50 Lee D. Rothstein
  0 siblings, 0 replies; 10+ messages in thread
From: Lee D. Rothstein @ 2008-05-09  7:50 UTC (permalink / raw)
  To: Cygwin

Cygwin FAQ says:

FAQ: Q: How do I print under Cygwin?
FAQ:
FAQ: A: There is no working lp or lpr system as you would find on
FAQ:    UNIX.
FAQ:
FAQ:    Jason Tishler has written a couple of messages that explain
FAQ:    how to use a2ps (for nicely formatted text in PostScript) and
FAQ:    ghostscript (to print PostScript files on non-PostScript
FAQ:    Windows printers). Start at
FAQ:    http://cygwin.com/ml/cygwin/2001-04/msg00657.html. Note that
FAQ:    the file command is now available as part of Cygwin setup.
FAQ:
FAQ:    Alternatively, on NT, you can use the Windows print command.
FAQ:    (It does not seem to be available on Win9x.) Type

I've gotten /usr/bin/lpr to work under Vista. So is the FAQ in error?

My problem is finding a filter for Epson printers. I guess the
best bet is man2html "to" FireFox, et al.

Lee Rothstein


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2008-07-24 17:20 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-18  9:08 lpr works? FAQ in error? Rodrigo Medina
  -- strict thread matches above, loose matches on Subject: below --
2008-05-09  8:44 Rodrigo Medina
2008-07-17 22:19 ` lpr " Lou Umscheid
2008-07-18  2:29   ` jrsyangl
2008-07-21 13:52     ` Wilfried
2008-07-21 14:12       ` Wilfried
2008-07-22 21:33         ` Buchbinder, Barry (NIH/NIAID) [E]
2008-07-23 20:01           ` Wilfried
2008-07-23 20:20             ` Mark J. Reed
2008-07-23 20:25               ` Mark J. Reed
2008-07-24 17:20               ` Buchbinder, Barry (NIH/NIAID) [E]
2008-05-09  7:50 Lee D. Rothstein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).