Operating System - HP-UX
1830085 Members
14918 Online
109998 Solutions
New Discussion

Spooler - Append Form Feed

 
SOLVED
Go to solution
Bill Brutzman
Frequent Advisor

Spooler - Append Form Feed


0. The printer prints but we need a form-feed after each greenbar print job.

1. The OS's are... HP-Ux v10, v11

2. The Printronix P300 tech manual indicates that the top of form command is... ^P

3. Without any luck, I have been thrashing with...

cat - | lp -d greenbar | ^P
cat - | lp -d greenbar | "^P"
cat - | lp -d greenbar | echo -n ^P
cat - | lp -d greenbar | echo -n "^P"

--Bill

4 REPLIES 4
RAC_1
Honored Contributor

Re: Spooler - Append Form Feed

What are these files that you print??
If files are coming from microsoft world, you may want to do dos2ux on those files.

If that does not help, How is this printer configured?? JetAdmin, network or remote??
If remote you can not do anything from OS side. If Jetadmin/Network, check the interface file and modify it to send form feed to the printer.

Anil
There is no substitute to HARDWORK
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Spooler - Append Form Feed

Well, it would help if you got the commands in the right order:

(cat - ; echo "\f\c") | lp -dgreenbar

or

(cat mytextfile; echo "\f\c") | lp -dgreenbar

"\f" is echo speak for FF.

You might find it easier to modify the printer's interface file to append the FF so that you don't have to add it to the lp command each time.
If it ain't broke, I can fix that.
Bill Hassell
Honored Contributor

Re: Spooler - Append Form Feed

This is a clssic problem that is solved using the printer's model script. If you are using the "dumb" model script, look in the directory /etc/lp/interface for your printer's script. NOTE: this is on the system where the printer is actually attached. You don't need to do anything on systems that declare the printer as remote on another computer.

At the bottom of the dumb printer script, you'll see:

cat "$file" 2>&1
echo "\014\c"

The cat command sends the file to the printer and the echo "\014\c" sends the ASCII code FF (formfeed) to the printer. (the man page for ascii calls 014 the np or newpage character) FormFeed is the classic (more then 20 years) method to eject the paper and works on every HP printer, LaserJet, DeskJet, even the old impact printers. 014 means octal 14 and comes from CTRL-L on a typical keyboard.

CTRL-P produces octal 020 which is the DLE character (see man ascii) so you can code this as: echo "\020\c" The \c in the echo suppresses the appending of CR/LF to the end of the string. So you can just change the end of the script in /etc/lp/interface from 014 to 020.

Now I mention the formfeed character because using DLE (Data Link Escape) is defined as: "A transmission control character that changes the meaning of a limited number of contiguously following characters or coded representations." which is ASCII-speak for a character that tells the device to change how it looks at subsequent chaarcter strings, similar to the ESC (Escape chaarcter). Since DLE is unusual as a form feed control, I would test that CTRL-P actually does produce a form feed. Try this:

echo "test\020" | lp -d greenbar

If this produces a form feed, then it is the correct character. If that doesn't work, use:

echo "test\014" | lp -d greenbar

and if that works, all is well and your printer should be ejecting paper at thye end of the job. Since it isn't, you may have to describe your connections (parallel, serial, remote, network, etc).


Bill Hassell, sysadmin
Bill Brutzman
Frequent Advisor

Re: Spooler - Append Form Feed


Problem solved. Clay's fix nailed it.

Thanks to Clay, Bill, and RAC.