Re: Best practice for CUPS-less foomatic use?

2014-11-01 Thread Predrag Punosevac
I know that many people were very frustrated when upstream broke
foomatic-rip for LPD users. Thanks to Antoine Jacoutot many of us will
be CUPS free for years to come. I am leaving internet trace for people
who would be looking for the info but Antoine documentation

/usr/local/share/doc/pkg-readmes/cups-filters-1.0.54p2

is golden standard.

In the nut shell what I did:

0. Install foomatic-rip, drivers (in my case hpijs), a2ps, ImageMagick

1. Edit /etc/printcap as
lp|HP|HP-PhotoSmart_C5200:\
:lp=/dev/ulpt0:\
:if=/etc/foomatic-rip/script.sh:\
:sh:sd=/var/spool/output:\
:lf=/var/log/lpd-errs:

2. Create /etc/foomatic-rip.script.sh and make it executable

#!/bin/sh

/usr/local/bin/a2ps -BRq --columns=1 -o - | \
/usr/local/bin/foomatic-rip -P HP-PhotoSmart_C5200 --ppd \
/etc/foomatic-rip/direct/hp-photosmart_c5200_series-hpijs.ppd

3. Add hp-photosmart_c5200_series-hpijs.ppd to /etc/foomatic-rip/direct

4. Adjust permission on ulpt0 and ugen devices. 

5. Start lpd daemon and be happy camper.

Cheers,
Predrag



Re: Best practice for CUPS-less foomatic use?

2014-02-27 Thread Jan Stary
On Feb 24 11:38:40, j...@jggimi.homeip.net wrote:
 I'm currently using foomatic-rip with lpd(8) for standard print, but find
 myself using foomatic-rip directly, without spooling, when I need to set
 a print option such as papersize or InputPort (tray).  
 
 I am not using apsfilter, which uses lpr(1)'s -C option to pass print
 options, as I am using the printer vendor's supplied PPD file with Foomatic.
 
 I am wondering how others are managing print options with Postscript printers.

To be sure: you only need foomatic to pass the _options_, right?
Because if it is a Postscript printer, you can print with just plain lpd
and do not need foomatic or apsfilter or (god forbid) CUPS. As in:

lp:lp=:rm=147.32.232.58:rp=lp:sd=/var/spool/output/lp:lf=/var/log/lpd.log:sf:sh



Re: Best practice for CUPS-less foomatic use?

2014-02-27 Thread Jan Stary
On Feb 24 16:51:22, j...@jggimi.homeip.net wrote:
 On Mon, Feb 24, 2014 at 06:36:35PM +0100, Andr?? St??be wrote:
 
  I had a similar setup some time ago. If I remember correctly, you can
  use lpr's -J option to pass options to foomatic-rip.
 
 Thank you, Andre'.
 
 I haven't found that the -J option works for me.  OTOH, the foomatic-rip -o
 operand does work with print options when printing directly.
 
 /etc/rc.conf.local contains:
 
 lpd_flags= 
 
 /etc/printcap is:
 
 lp|printer:\
   :lp=:rm=printer:\
   :af=/etc/foomatic/hp-lj_300_400_color_m351_m451-ps.ppd:\
   :if=/usr/local/bin/foomatic-rip:\
   :sh:mx#0:\
   :sd=/var/spool/output:\
   :lf=/var/log/lpd-errs:

Quoting directly from printcap(5):

The if filter is invoked with arguments:

if [-c] -wwidth -llength -iindent -n login -h host acct-file

The -c flag is passed only if the -l flag (pass control characters
literally) is specified to lpr(1). width and length specify the page
width and length (from pw and pl, respectively) in characters.  The
-n and -h parameters specify the login name and host name
of the owner of the job, respectively. The acct-file function
is passed from the af printcap entry.


I don't think there is some other way to pass any more Postscript options
in your lpr line that would get to the if script (foomatic). You can run
a script (if = foomatic) and give it an argument (af = PPD),
but I think that's all.



Re: Best practice for CUPS-less foomatic use?

2014-02-27 Thread Josh Grosse
On Thu, Feb 27, 2014 at 10:26:32AM +0100, Jan Stary wrote:

 To be sure: you only need foomatic to pass the _options_, right?

That was my intent, yes.  

On Thu, Feb 27, 2014 at 10:36:13AM +0100, Jan Stary wrote:

 Quoting directly from printcap(5):

[snip]

 I don't think there is some other way to pass any more Postscript options
 in your lpr line that would get to the if script (foomatic). You can run
 a script (if = foomatic) and give it an argument (af = PPD),
 but I think that's all.

Thank you.  I may test having multiple queues each with its own PPD with
different defaults set (PageSize, InputSlot, etc.) but I may end up deploying
print/cups with print/hplip just for operational simplicity. 



Re: Best practice for CUPS-less foomatic use?

2014-02-25 Thread André Stöbe
Josh Grosse wrote:
 I haven't found that the -J option works for me.  OTOH, the foomatic-rip -o
 operand does work with print options when printing directly.

Are you sure? I've used this in conjunction with the options defined in
the PPD file.

Try foomatic-ppd-options
/etc/foomatic/hp-lj_300_400_color_m351_m451-ps.ppd
and see if you can pass any of these options.

Regards
André



Re: Best practice for CUPS-less foomatic use?

2014-02-25 Thread Josh Grosse
On Tue, Feb 25, 2014 at 10:03:27AM +0100, Andr?? St??be wrote:
 Josh Grosse wrote:
  I haven't found that the -J option works for me.  OTOH, the foomatic-rip -o
  operand does work with print options when printing directly.
 
 Are you sure? I've used this in conjunction with the options defined in
 the PPD file.
 
 Try foomatic-ppd-options
 /etc/foomatic/hp-lj_300_400_color_m351_m451-ps.ppd
 and see if you can pass any of these options.

I'm sure.  Here's an example:

$ foomatic-rip -o InputSlot=Tray1_Man myfile.ps

The printer prompts for media to be manually loaded in Tray 1

$ lpr -J InputSlot=Tray1_Man myfile.ps

The printer prints from Tray 2 immediately.



Best practice for CUPS-less foomatic use?

2014-02-24 Thread Josh Grosse
I'm currently using foomatic-rip with lpd(8) for standard print, but find
myself using foomatic-rip directly, without spooling, when I need to set
a print option such as papersize or InputPort (tray).  

I am not using apsfilter, which uses lpr(1)'s -C option to pass print
options, as I am using the printer vendor's supplied PPD file with Foomatic.

I am wondering how others are managing print options with Postscript printers.



Re: Best practice for CUPS-less foomatic use?

2014-02-24 Thread André Stöbe
Josh Grosse wrote:
 I'm currently using foomatic-rip with lpd(8) for standard print, but find
 myself using foomatic-rip directly, without spooling, when I need to set
 a print option such as papersize or InputPort (tray).  
 
 I am not using apsfilter, which uses lpr(1)'s -C option to pass print
 options, as I am using the printer vendor's supplied PPD file with Foomatic.
 
 I am wondering how others are managing print options with Postscript printers.

I had a similar setup some time ago. If I remember correctly, you can
use lpr's -J option to pass options to foomatic-rip.

Regards
André



Re: Best practice for CUPS-less foomatic use?

2014-02-24 Thread Josh Grosse
On Mon, Feb 24, 2014 at 06:36:35PM +0100, Andr?? St??be wrote:

 I had a similar setup some time ago. If I remember correctly, you can
 use lpr's -J option to pass options to foomatic-rip.

Thank you, Andre'.

I haven't found that the -J option works for me.  OTOH, the foomatic-rip -o
operand does work with print options when printing directly.

/etc/rc.conf.local contains:

lpd_flags= 

/etc/printcap is:

lp|printer:\
:lp=:rm=printer:\
:af=/etc/foomatic/hp-lj_300_400_color_m351_m451-ps.ppd:\
:if=/usr/local/bin/foomatic-rip:\
:sh:mx#0:\
:sd=/var/spool/output:\
:lf=/var/log/lpd-errs:


I'm using a recent snapshot that includes patch 1.52 to
usr.sbin/lpr/lpd/printjob.c for remote lpd:

kern.version=OpenBSD 5.5-beta (GENERIC.MP) #239: Fri Feb 21 02:38:36 MST 2014
dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP



Re: Best practice for CUPS-less foomatic use?

2014-02-24 Thread Josh Grosse
On Mon, Feb 24, 2014 at 04:51:22PM -0500, Josh Grosse wrote:

 I haven't found that the -J option works for me.  OTOH, the foomatic-rip -o
 operand does work with print options when printing directly.

To be clear, the symptom is that -J option=value has no effect.  No errors
or warnings are produce in lpd-errs.