[6.2.1] spooler filter ???

I would like to set up spooler so that photon print directly to a remote
postscript printer via lpr.

/etc/printcap is ok
lpd / lpr work fine.
what is the magic syntax for /usr/sbin/spooler so it print througth lpr (not
device)

I’ve tried
spooler -n HP1200PS -s /usr/spool/output/lpd/HP1200PS -c ps.cfg -d
/dev/null -F -v
but that simply launch phs-to-ps myspoolfile > /dev/null
I would like it to become phs-to-ps myspoolfile | lpr -P myprinter

thanx for your time.


dominix

dominix <dominix@despammed.com> wrote:

I would like to set up spooler so that photon print directly to a remote
postscript printer via lpr.

/etc/printcap is ok
lpd / lpr work fine.
what is the magic syntax for /usr/sbin/spooler so it print througth lpr (not
device)

I’ve tried
spooler -n HP1200PS -s /usr/spool/output/lpd/HP1200PS -c ps.cfg -d
/dev/null -F -v
but that simply launch phs-to-ps myspoolfile > /dev/null
I would like it to become phs-to-ps myspoolfile | lpr -P myprinter

Here’s a section from the Neutrino User’s Guide (which we’re including in
release 6.3). I hope it helps you.

Remote printing over TCP/IP

If you want to set up spooler to print on a remote printer, you can
pipe the print job to [66]lpr. This takes advantage of the fact that
the filter sends the print job to the printer; you just name the
remote printer in the filter command line of the configuration file
used by spooler.

To try it, first get your remote printer working using lpr (see
“[67]Remote printing to a TCP/IP-enabled printer using lpr”), then do
the following:

  1. Copy the configuration file from the printer you want to use (in
    this case, a PostScript printer):

cp /etc/printers/ps.cfg /etc/printers/test.cfg

  1. Find the filter command lines in test.cfg; they look like this:

Filter = phs:$d:phs-to-ps
Filter = raw:$d:cat

These filter command lines are in the form:

source:destination:filter

The phs filter command line tells the filter to process .phs files
by sending them through a filter called [68]phs-to-ps before
sending them on to the destination passed by [69]spooler. The raw
filter command is for utilities that already produce the correct
output for the printer.

  1. Change the phs filter command line from this:

Filter = phs:$d:phs-to-ps

to this:

Filter = phs:ps:phs-to-ps

  1. Add a line to tell the filter to send all PostScript files to the
    remote printer, rlpt2:

Filter ps:$d:lpr -Prlpt2

What you’ve done is change the destination from that given by
spooler to ps, so that after the .phs file has been converted to a
ps type by phs-to-ps, it goes to the ps filter. Then the ps filter
line you added sends PostScript files to lpr, forcing output to
the remote printer (just as you did in “[70]Remote printing to a
TCP/IP-enabled printer using lpr”).

You might be wondering what happened to the destination passed by
spooler ($d). Well, that is discarded because lpr (unlike
phs-to-ps) doesn’t return the job to the filter but completes it
itself.

  1. Finally, start a new instance of spooler, telling it the pathname
    of your new configuration file (in this case
    /etc/printers/test.cfg) and the name of the printer you want to
    use (in this case rlpt2), like this:

spooler -d /dev/null -c /etc/printers/test.cfg -n rlpt2 &

The -n option specifies the name of the printer, which appears in
a Photon application’s Print dialog.

  1. If you want to start spooler like this whenever you boot your
    machine, add the above command to your /etc/rc.d/rc.local file.
    For more information, see Controlling How Neutrino Starts.

Now, you should be able to print your PostScript file on your remote
TCP/IP-enabled printer, either from Photon or from the command line.

  • Remote printing from Photon:
    Select the correct printer (in this example, rlpt2) in the Select
    Printer dialog box.

  • Remote printing from the command line:
    Copy the print file to the directory that spooler uses:

cp /root/my_file.ps /dev/printers/rlpt2/spool/

\

Steve Reid stever@qnx.com
TechPubs (Technical Publications)
QNX Software Systems

“Steve Reid” <stever@sreid.ott.qnx.com> a écrit dans le message de
news:c6b63j$fbm$1@nntp.qnx.com

dominix <> dominix@despammed.com> > wrote:
I would like to set up spooler so that photon print directly to a remote
postscript printer via lpr.

what is the magic syntax for /usr/sbin/spooler so it print througth lpr
(not
device)

Here’s a section from the Neutrino User’s Guide (which we’re including in
release 6.3). I hope it helps you.

Remote printing over TCP/IP

cp /etc/printers/ps.cfg /etc/printers/test.cfg

  1. Find the filter command lines in test.cfg; they look like this:

Filter = phs:$d:phs-to-ps
Filter = raw:$d:cat


3. Change the phs filter command line from this:

Filter = phs:$d:phs-to-ps

to this:

Filter = phs:ps:phs-to-ps

  1. Add a line to tell the filter to send all PostScript files to the
    remote printer, rlpt2:

Filter ps:$d:lpr -Prlpt2


5. Finally, start a new instance of spooler, telling it the pathname
of your new configuration file (in this case
/etc/printers/test.cfg) and the name of the printer you want to
use (in this case rlpt2), like this:

spooler -d /dev/null -c /etc/printers/test.cfg -n rlpt2 &

thanks steve I got it.


dominix