Welcome to FreeBSDFreaks.net!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

[ help please ] - I can't print

 
   FreeBSD Hosting (Home) -> FreeBSD Handbook RSS
Next:  Problems with FreeBSD authentication  
Author Message
Charles

External


Since: Sep 11, 2004
Posts: 6



(Msg. 1) Posted: Thu Sep 23, 2004 9:21 pm
Post subject: [ help please ] - I can't print
Archived from groups: comp>unix>bsd>freebsd>misc (more info?)

I have tried to setup my old Epson Laser EPL-5700 printer.
I have followed the printing section of the FreeBSD Handbook as well as
the Printing Troubleshooting part. Here's the problem:

When I type

lptest > /dev/lpt0

my printer prints a normal line with numbers and letters. Then, when I type

lptest 20 5 | lpr -Pepson

it won't print anything. The "form feed" blinks however when I send this
command.

Here's my input filter:

# ee /usr/local/libexec/if-simple
#!/bin/sh
#
# if-simple - Simple text input filter for lpd
# Installed in /usr/local/libexec/if-simple
#
# Simply copies stdin to stdout. Ignores all filter arguments.
/bin/cat && exit 0
exit 2

And here's my printcap file:

# ee /etc/printcap
epson|lp:\
:sh:sd=/var/spool/epson:\
:lp=/dev/lpt0:\
:if=/usr/local/libexec/if-simple:\
:lf:

Here's some other info:

cd /var/spool/epson
# ls
.seq lock status


The lpd daemon is also on.

Thanks a bunch,


--
Charles.

For news on Open-Source in general, try alt.comp.opensource

"Did you have your Win dose today?"

 >> Stay informed about: [ help please ] - I can't print 
Back to top
Login to vote
Warren Block

External


Since: Dec 28, 2003
Posts: 43



(Msg. 2) Posted: Fri Sep 24, 2004 12:57 am
Post subject: Re: [ help please ] - I can't print [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Charles wrote:
> I have tried to setup my old Epson Laser EPL-5700 printer.
> I have followed the printing section of the FreeBSD Handbook as well as
> the Printing Troubleshooting part. Here's the problem:
>
> When I type
>
> lptest > /dev/lpt0
>
> my printer prints a normal line with numbers and letters. Then, when I type
>
> lptest 20 5 | lpr -Pepson
>
> it won't print anything. The "form feed" blinks however when I send this
> command.

It's working normally. When your printer receives less than 60 lines,
you need to send a form feed to get it to eject the partial page. On
some printers you can press the form feed button. (60 lines is a
pageful on most laser printers.)

Fancier input filters will generate a form feed for you, or you can send
it manually:

perl -e 'print chr(12)' | lpr -Pepson

I use enscript to produce nicely-formatted PostScript output. If your
printer isn't PostScript, you could feed the enscript output to
Ghostscript.

--
Warren Block * Rapid City, South Dakota * USA

 >> Stay informed about: [ help please ] - I can't print 
Back to top
Login to vote
Steve O'Hara-Smith

External


Since: Sep 10, 2003
Posts: 42



(Msg. 3) Posted: Fri Sep 24, 2004 6:59 am
Post subject: Re: [ help please ] - I can't print [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Fri, 24 Sep 2004 00:57:52 -0000
Warren Block wrote:


> Fancier input filters will generate a form feed for you, or you can send
> it manually:
>
> perl -e 'print chr(12)' | lpr -Pepson

Using perl for this is a sledgehammer to crack a nut - here is a
filter that adds a form feed.

#!/bin/sh
/bin/cat
/bin/echo -n ^L

NB: that ^L is produced in vi by typing <ctrl>-V<ctrl>-L.

--
C:>WIN | Directable Mirror Arrays
The computer obeys and wins. | A better way to focus the sun
You lose and Bill collects. | licences available see
| http://www.sohara.org/
 >> Stay informed about: [ help please ] - I can't print 
Back to top
Login to vote
jpd

External


Since: Sep 10, 2003
Posts: 58



(Msg. 4) Posted: Fri Sep 24, 2004 10:08 am
Post subject: Re: [ help please ] - I can't print [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2004-09-24, Warren Block wrote:
[snip]
> It's working normally. When your printer receives less than 60 lines,
> you need to send a form feed to get it to eject the partial page. On
> some printers you can press the form feed button. (60 lines is a
> pageful on most laser printers.)

Time for a bit of ObPedantry: If your paper format is letter. The lj5k
I last counted rows on did 65 in default config with the default font,
and with minor twiddling of margins I had 66.


> Fancier input filters will generate a form feed for you, or you can send
> it manually:
>
> perl -e 'print chr(12)' | lpr -Pepson

You don't need perl to print a single character:

printf '\014' | lpr

(ascii(7) is helpful if you're too lazy to do the ->octal math)


> I use enscript to produce nicely-formatted PostScript output. If your
> printer isn't PostScript, you could feed the enscript output to
> Ghostscript.

Oh woe, why are not all printers postscript. Anyway, thanks for that
one, it looks useful. EG to print (letter formatted) RFCs on A4. (*sigh*)


--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
 >> Stay informed about: [ help please ] - I can't print 
Back to top
Login to vote
Charles

External


Since: Sep 11, 2004
Posts: 6



(Msg. 5) Posted: Fri Sep 24, 2004 11:49 am
Post subject: Re: My updated file [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Em Fri, 24 Sep 2004 00:57:52 -0000, Warren Block
escreveu:

> Charles wrote:
>> I have tried to setup my old Epson Laser EPL-5700 printer.
>> I have followed the printing section of the FreeBSD Handbook as well as
>> the Printing Troubleshooting part. Here's the problem:
>>
>> When I type
>>
>> lptest > /dev/lpt0
>>
>> my printer prints a normal line with numbers and letters. Then, when I
>> type
>>
>> lptest 20 5 | lpr -Pepson
>>
>> it won't print anything. The "form feed" blinks however when I send this
>> command.
>
> It's working normally. When your printer receives less than 60 lines,
> you need to send a form feed to get it to eject the partial page. On
> some printers you can press the form feed button. (60 lines is a
> pageful on most laser printers.)
>
> Fancier input filters will generate a form feed for you, or you can send
> it manually:
>
> perl -e 'print chr(12)' | lpr -Pepson
>
> I use enscript to produce nicely-formatted PostScript output. If your
> printer isn't PostScript, you could feed the enscript output to
> Ghostscript.
>

Ok, I then tried to print a document with OpenOffice.org, and I only get
headers in a staired way.
I 've been trying to find help here:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/printing-tro...eshooti
I also found out that my Epson printer has this escape code: either "CR"
or "13"
This is my updated input filter file:

printf "13" && /bin/cat && printf "\f" && exit 0
exit 2

The printer won't print anything else than staired headers :'(
Thanks,

--
Charles.

For news on Open-Source in general, try alt.comp.opensource

"Did you have your Win dose today?"
 >> Stay informed about: [ help please ] - I can't print 
Back to top
Login to vote
Warren Block

External


Since: Dec 28, 2003
Posts: 43



(Msg. 6) Posted: Fri Sep 24, 2004 7:41 pm
Post subject: Re: [ help please ] - I can't print [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

jpd wrote:
> On 2004-09-24, Warren Block wrote:
> [snip]
>> It's working normally. When your printer receives less than 60 lines,
>> you need to send a form feed to get it to eject the partial page. On
>> some printers you can press the form feed button. (60 lines is a
>> pageful on most laser printers.)
>
> Time for a bit of ObPedantry: If your paper format is letter. The lj5k
> I last counted rows on did 65 in default config with the default font,
> and with minor twiddling of margins I had 66.

I had even started to write a note about fonts and then deleted it as
too much detail. Oh well.

>> Fancier input filters will generate a form feed for you, or you can send
>> it manually:
>>
>> perl -e 'print chr(12)' | lpr -Pepson
>
> You don't need perl to print a single character:
>
> printf '\014' | lpr

Or echo "ctrl-Vctrl-L", but that's harder to explain. It still bugs me
that echo doesn't understand \n and so forth. At one point, I remember
finding a reason for that, but don't recall it now.

> (ascii(7) is helpful if you're too lazy to do the ->octal math)

But using Perl skips that step, and chr(12) has meant form feed to me
for a long time. Besides which, I enjoy smashing little problems with a
big hammer.

--
Warren Block * Rapid City, South Dakota * USA
 >> Stay informed about: [ help please ] - I can't print 
Back to top
Login to vote
Warren Block

External


Since: Dec 28, 2003
Posts: 43



(Msg. 7) Posted: Fri Sep 24, 2004 7:51 pm
Post subject: Re: My updated file [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Charles wrote:

> Ok, I then tried to print a document with OpenOffice.org, and I only get
> headers in a staired way.

The stairstepping is classic Unix linefeed versus carriage return;
there's a note about it in the printing section of the Handbook.

What do you mean by "headers"? OpenOffice may just print in PostScript.
If so, you'll have to get Ghostscript involved here. And you'll likely
need it for other stuff anyway. PostScript should start with "%!PS".

So install either /usr/ports/print/ghostscript-gnu-nox11 or
/usr/ports/print/ghostscript-gnu.

Then you need an input filter, which isn't too hard:

http://groups.google.com/groups?&selm=slrnamid60.113d.wblock%40w0nkity...nkity.c

--
Warren Block * Rapid City, South Dakota * USA
 >> Stay informed about: [ help please ] - I can't print 
Back to top
Login to vote
jpd

External


Since: Sep 10, 2003
Posts: 58



(Msg. 8) Posted: Fri Sep 24, 2004 7:52 pm
Post subject: Re: My updated file [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2004-09-24, Charles wrote:
> Ok, I then tried to print a document with OpenOffice.org, and I only get
> headers in a staired way.
[snip]
> I also found out that my Epson printer has this escape code: either "CR"

You're misunderstanding the problem. Try this snippet on for size:

--->8-- addcr.awk -----
#!/usr/bin/awk -f
{ printf "%s\r\n", $0 }
----8<----

What it does? It reads each line (which, on unices, only ends in one LF,
or \n, or decimal 10, or hex 0xA, or octal \012) and your printer wants
a CR, (or dec 13, hex 0xD, or octal \015), too: The LF advances a row,
but the cursor doesn't get reset to the start of line, which is what the
CR does. You could write it in sh(1), too, but I'm lazy. It can also
easily be amended to emit a form-feed character at the end.


--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
 >> Stay informed about: [ help please ] - I can't print 
Back to top
Login to vote
jpd

External


Since: Sep 10, 2003
Posts: 58



(Msg. 9) Posted: Fri Sep 24, 2004 8:00 pm
Post subject: Re: My updated file [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2004-09-24, Warren Block wrote:
> Charles wrote:
>
>> Ok, I then tried to print a document with OpenOffice.org, and I only get
>> headers in a staired way.
>
> The stairstepping is classic Unix linefeed versus carriage return;
> there's a note about it in the printing section of the Handbook.
>
> What do you mean by "headers"? OpenOffice may just print in PostScript.
> If so, you'll have to get Ghostscript involved here. And you'll likely
> need it for other stuff anyway. PostScript should start with "%!PS".

Oops, interpreter problem. Charles'd better fix that instead of worrying
about the stairstepping. I'd retract my other post but for the explanation
being valid when one does want to print plain text.


--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
 >> Stay informed about: [ help please ] - I can't print 
Back to top
Login to vote
Patrick TJ McPhee

External


Since: Mar 23, 2004
Posts: 4



(Msg. 10) Posted: Sun Sep 26, 2004 4:42 pm
Post subject: Re: [ help please ] - I can't print [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article ,
jpd wrote:

% You don't need perl to print a single character:
%
% printf '\014' | lpr
%
% (ascii(7) is helpful if you're too lazy to do the ->octal math)

Even more useful is the built-in form-feed escape character

printf '\f' | lpr

--

Patrick TJ McPhee
East York Canada
ptjm.RemoveThis@interlog.com
 >> Stay informed about: [ help please ] - I can't print 
Back to top
Login to vote
jpd

External


Since: Sep 10, 2003
Posts: 58



(Msg. 11) Posted: Mon Sep 27, 2004 4:25 pm
Post subject: Re: [ help please ] - I can't print [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 2004-09-26, Patrick TJ McPhee wrote:
> In article ,
> jpd wrote:
> % You don't need perl to print a single character:
> %
> % printf '\014' | lpr
> %
> % (ascii(7) is helpful if you're too lazy to do the ->octal math)
>
> Even more useful is the built-in form-feed escape character
>
> printf '\f' | lpr

And I'd assumed since it doesn't take \0x it doesn't take fancier stuff.
Should've checked the manual. Smile


--
j p d (at) d s b (dot) t u d e l f t (dot) n l .
 >> Stay informed about: [ help please ] - I can't print 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Installation & fdisk partitioning (slices) - I picked up a copy of the "FreeBSD Handbook 2nd Ed" the other day, it came with a installation disk for version 5.1 Current and that is what I am trying to install. This is my first attempt to do anything with FreeBSD. First let me describe my...

CVSup vs. portupgrade - Reading from the FreeBSD handbook on "Using the Ports Collection" leaves me a bit confused wrt CVSup and portupgrade... do these utilities accomplish the same thing? Thanks, Jay _______________________________________________..

configuring freebsd dhcp server/router to listen on device - Hello, Im trying to move away from my linksys wireless router and move onto an old Pentium 200 Mhz I have. It will be the gateway between my modem and my network. I installed isc-dhcp3 on the box and took the sample dhcp.conf file in the freebsd..

PPP - Hi! I'm french and don't understand the chapter 18.2.1.2 (Creating PPP device Nodes) in the freeBSD handbook. Precicely I don't understand what is N in the first paragraph. Is it necessary to change the tun0? I have an other question.(I'm sorry if it..

PPP - Hi!! In the FreeBSD handbook, the chapter 18.3.3 talk about the file /etc/ppp/options. I think I must create it and copy that it's written in the handbook concerning this file but I'm not sure. Xavier --------------------------------- Yahoo! Mail...
   FreeBSD Hosting (Home) -> FreeBSD Handbook All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]