# Sample /etc/printcap for network laser printer



## cpcnw (Apr 21, 2010)

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


```
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!


----------



## robbak (Apr 21, 2010)

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.


----------



## cpcnw (Apr 21, 2010)

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@ (Apr 21, 2010)

I have some samples in my LPD printing document:http://www.wonkity.com/~wblock/docs/html/lpdprinting.html


----------



## cpcnw (Apr 24, 2010)

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!


----------



## wblock@ (Apr 24, 2010)

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:

```
#!/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.


----------



## cpcnw (Apr 25, 2010)

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?


----------



## wblock@ (Apr 26, 2010)

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.


----------



## cpcnw (Apr 26, 2010)

OK, on first page I get a simple header ;


```
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?


----------



## wblock@ (Apr 26, 2010)

cpcnw said:
			
		

> OK, on first page I get a simple header ;
> 
> 
> ```
> ...



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 
	
	



```
%!|\033%%)
```
That's a percent, exclamation, vertical bar, backslash, 033, percent, percent, right-paren.

You could also simplify it to just
	
	



```
%!)
```


----------



## cpcnw (Apr 26, 2010)

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!


----------



## cpcnw (Apr 26, 2010)

Just for the record here is my working printcap for a HPBIJ1200 on USB and Kyocera FS-1010 Network printer!

```
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:
```


----------



## wblock@ (Apr 26, 2010)

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!


----------

