- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Using rmodel to insert printer escape sequence...
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2001 03:25 PM
12-19-2001 03:25 PM
Using rmodel to insert printer escape sequences
My goal is to customize an interface script (using rmodel as the starting point) so that the -olandscape option will actually work when used with the lp command.
My lp command will look like this:
lp -dtestprtr -olandscape testfile
Here are the changes I made to the /usr/spool/lp/interface/testprtr script (created from rmodel):
for i in $5
do
#
# check for 'regular' lp options
#
case "$i" in
hpgl | hpgl2 | pcl | raw) # Files assume no page breaks.
BSDformat=-l
;;
ps | postscript) # Files contain Postscript data.
BSDformat=-o
;;
#My changes start here
landscape)
sed -e '1s/.*/^[\&l1O/' -e '$s/.*/&^[E/' $6 > $6.new
cp -f $6.new $6
;;
#My changes end here
esac
This code results in escape sequence Esc&l1O (landscape orientation) being inserted at the beginning of the first line of the print file, and EscE (reset printer) being inserted at the end of the last line.
I have verified that this code does indeed result in the escape sequences being inserted at the proper places prior to the execution of the rlp command.
The problem is, when the file prints on the printer, the printer ignores the escape sequences. Instead, the printable characters of the escape sequences simply print as text at the top and bottom of the print out.
Now, the weird part is, if I do the following:
sed -e '1s/.*/^[\&l1O/' -e '$s/.*/&^[E/' testfile > testfile.new
lp -dtestprtr testfile.new
the printer DOES observe the escape sequences imbedded in the print file!!
I don't understand what is different in these two scenarios, because the content of the printfile should be identical in both.
Any help would be appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2001 05:40 PM
12-19-2001 05:40 PM
Re: Using rmodel to insert printer escape sequences
Send ESC sequence not support in remote printing , cause all formatting was done at printer owner.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 07:09 AM
02-20-2002 07:09 AM
Re: Using rmodel to insert printer escape sequences
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 07:30 AM
02-20-2002 07:30 AM
Re: Using rmodel to insert printer escape sequences
This is strange. On our Laser4's and 5's the lp -olandscape option works fine with the standard printer model script -no customization necessary. Is there something strange with your printer setup ? are you routing prints through some non HP box (a PC or NT box or something) which is stripping off the landscape stuff, or is the printer setup aok ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2002 07:36 AM
02-20-2002 07:36 AM
Re: Using rmodel to insert printer escape sequences
Try doing it without the BSD option selected.
You have the same script but the spooler sends the -olandscape through when BSD is not selected.
Otherwise
Put echo "\033&l1O\c" in another file and print by
cat otherfile printfile|lp -dremoteprinter
Steve Steel