Sample /etc/printcap for network laser printer

Hi All,

Does anyone have a working printcap entry they could post for a network laser printer?

I have a Kyocera Mita FS-1010 on same subnet and was hoping to print more than ascii to it.

On same box I have a HP1200 BIJ which is working fine.

So far I've added an alias to /etc/hosts

Code:
192.168.1.12  KYOCERA

and goofed around with various options in printcap. Plain text seem to work ok but say printing from Opera results in red light on printer.

Any help appreciated, thanks!
 
It is all simple if the printer accepts postscript. But as you talk of red lights, it is unlikely - but check the manuals and openprinting.org.

If not, you are going to need ghostscript and/or gutenprint (or maybe something even worse.) Openprinting.org should get you started. Either of those is set up as a _filter_ to take the postscript input and output whatever page description language that Kyocera needs.
 
It does indeed accept Postscript :)

Have Ghostscript already working for HP1200BIJ

Would just like a peek at a working printcap for a network printer ....
 
wblock - thanks for posting that. You couldn't post your psif filter to the forum could you? I seem to still having problems and I think I'm not getting the right chars from the kb in my version copied from the pdf.

My printer [Kyocera FS-1010] has various options including creating 'logical' printer with a choice of filtering. One of those is ASCII to Postcript.

Does this mean I should be able to send 'anything' and it should be printed?

Also, what does entry :mx#0: do?

Thanks alot!
 
cpcnw said:
wblock - thanks for posting that. You couldn't post your psif filter to the forum could you? I seem to still having problems and I think I'm not getting the right chars from the kb in my version copied from the pdf.

The quotes look like the editor messed with them. Sorry, I will work on that. Here's the original, which is just a variation on the psif from the Handbook to handle PJL:
Code:
#!/bin/sh
IFS="" read -r first_line
first_two_chars=`expr "$first_line" : '\(..\)'`

case "$first_two_chars" in
%!|\033%%)
    # %! or ESC% : PostScript job, print it.
    echo "$first_line" && cat && printf "\004" && exit 0
    exit 2
    ;;
*)
    # otherwise, format with enscript
    ( echo "$first_line"; cat ) | /usr/local/bin/enscript -o - && printf "\004" && exit 0
    exit 2
    ;;
esac

My printer [Kyocera FS-1010] has various options including creating 'logical' printer with a choice of filtering. One of those is ASCII to Postcript.

Does this mean I should be able to send 'anything' and it should be printed?

I'm not sure what that means; possibly a queue that auto-formats ASCII into PostScript like enscript does. If that's correct, it would mean anything printed there would come out as text, not what you want if you send a PostScript file.

Also, what does entry :mx#0: do?

Allows unlimited size on print jobs.
 
wb - got your msg and thanks for posting your psif - I had 2 chars transposed. Now I fixed that I can send ascii and it prints nice. Now problem I got is say from Opera, I get reams of text on pages and pages. I'm kind of guessing that the output is not be converted / understood by the printer as ps and its just printing the ascii equiv?

The printer spec says :-

Language Simulation: PCL 5E, PostScript 2, PCL 6, EPSON LQ

Would I need to convert the output of Opera to ps using gs?
 
cpcnw said:
wb - got your msg and thanks for posting your psif - I had 2 chars transposed. Now I fixed that I can send ascii and it prints nice.

Great! I fixed that in the PDF, too.

Now problem I got is say from Opera, I get reams of text on pages and pages. I'm kind of guessing that the output is not be converted / understood by the printer as ps and its just printing the ascii equiv

Hard to say. If Opera lets you, print to a file. Use the file(1) command on it to see what type of output is being created. Or just look at the first few characters printed; PS will be "%!PS" (maybe, sometimes there are PJL commands or other job stuff first).

There's a sample PS file in the PDF if you want to prove that your printer can handle it.

If you need a smarter filter than psif, print/apsfilter in ports is popular.

You should also check your desktop environment print settings. With xfce, set Settings/Printing to BSD/LPR. I don't use GNOME/KDE, can't help with them.
 
OK, on first page I get a simple header ;

Code:
Sun Apr 25 22:27:17 2010     1

Line 1) %!PS-Adobe-1.0
Following this alot of lines [about 12] starting %

So, the printer is printing ps as ascii?
 
cpcnw said:
OK, on first page I get a simple header ;

Code:
Sun Apr 25 22:27:17 2010     1

Line 1) %!PS-Adobe-1.0
Following this alot of lines [about 12] starting %

So, the printer is printing ps as ascii?

Yes. The date header looks like it's going through enscript, which would mean the psif script is failing. Maybe cut-and-paste didn't handle the escapes right. Please check your psif and verify that the line after the case statement is
Code:
%!|\033%%)
That's a percent, exclamation, vertical bar, backslash, 033, percent, percent, right-paren.

You could also simplify it to just
Code:
%!)
 
Bingo! Did a cut and paste of your posted psif and can now print straight from Opera. What role does a .ppd play in all this? I have one for this printer but is there any point in using it?

Thanks for all your work on this!
 
Just for the record here is my working printcap for a HPBIJ1200 on USB and Kyocera FS-1010 Network printer!
Code:
HP1200|HP1200|HP Business Inkjet 1200:\
	:lp=/dev/ulpt0:\
	:af=/etc/ppd/HP_Business_Inkjet_1200.ppd:\
	:if=/usr/local/libexec/ifhp:\
	:sh:sd=/var/spool/lpd:\
	:lf=/var/log/lpd-errs:

FS-1010|FS-1010|Kyocera FS-1010:\
	:sh:\
	:mx#0:\
	:rp="auto":\
	:rm=FS-1010:\
	:sd=/var/spool/laser:\
	:lf=/var/log/lpd-errs:\
	:lp= FS-1010%9101:\
	:if=/usr/local/libexec/psif:
 
cpcnw said:
Bingo! Did a cut and paste of your posted psif and can now print straight from Opera. What role does a .ppd play in all this? I have one for this printer but is there any point in using it?

PPD files are used by CUPS and other printing software. lpd doesn't care about them at all, but they may be used internally by filters that are more complicated and smarter than psif.

Thanks for all your work on this!

You're welcome!
 
Back
Top