dominix <email@example.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
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 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
“Remote printing to a TCP/IP-enabled printer using lpr”), then do
- 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
- 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:
The phs filter command line tells the filter to process .phs files
by sending them through a filter called phs-to-ps before
sending them on to the destination passed by spooler. The raw
filter command is for utilities that already produce the correct
output for the printer.
- Change the phs filter command line from this:
Filter = phs:$d:phs-to-ps
Filter = phs:ps:phs-to-ps
- 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 “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
- 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.
- 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 firstname.lastname@example.org
TechPubs (Technical Publications)
QNX Software Systems