Setting printer paper length using unix commands


 
Thread Tools Search this Thread
Operating Systems HP-UX Setting printer paper length using unix commands
# 1  
Old 12-18-2011
Setting printer paper length using unix commands

Hi Guys,
I have been trying to resolve a printing problem but nothing works out .
I have an Epson LQ 680 (dot matrix printer) . I need to print a file . The paper length should be 34 .Left margin should be 5. I have tried the following things after researching from the man pages.

Code:
pr -t -l34 -o5 fileName | lp
lp -dprintername -olength=34 -onopagebreak fileName

But in both these cases i get a problem where in the first page is printed properly but the second page and pages after spits out blank lines and it doesn't obey the page length .
My other case was
Code:
pr -F -o5 fileName | lp

where form feed characters are read properly amd aligned but the printer takes default length of paper size as 66. I need to override this paper length settings through shell script whenever i print.
Since other applications use the same printer i can't set the page size in the server .

I am using HP - UX , Bourne Shell.

I heard that we can echo the printer settings in unix.I have the printer codes in Hexa decimal values. (\x1B\x43\x21)

Have tried using
Code:
echo $
echo ""

But nothing is working.I am a newBee to Unix .

Any help on how to echo the printer page length dynamically using any unix commands .

---------- Post updated 12-18-11 at 11:41 AM ---------- Previous update was 12-17-11 at 09:53 PM ----------

Has anyone faced this issue Guys .Please let me know if so.. Thanks

Last edited by Scott; 12-27-2011 at 12:51 PM.. Reason: Removed pointless poll
# 2  
Old 12-19-2011
What HP-UX version?
How is configured the printer?
# 3  
Old 12-19-2011
This seems to be a 10-year-old printer for DOS and early Windows.
Epson LQ-680Pro, Documents & Manuals - Technical Support - Epson America, Inc.

Which HP computer?
Which HP-UX version?
How is this printer physicaly connected to the HP computer?
If it is actually connected to the network, how is this achieved and is there a HP Jet Direct Box?
If it is actually connected to a Windows server, please describe how that is configured and how the HP-UX server sends print.
How was the print queue installed in HP-UX? Was there any special printer driver software for HP-UX from Epson?


Code:
Addendum: That Escape sequence looks familiar (standard Epson one).
 (\x1B\x43\x21)         Is the same as ESC C 33   (set page length to 33 lines.

We have to work in Octal for the Escape Character and the Number in Shell.

If you don't have a special Epson print filter and you wish to send that escape sequence before your printout file called "fileName":
Code:
(
echo "\0033C\0041\c"
cat fileName
) | lp -d printername    ....etc

However of there is some other driver there it will override your settings. Really need to know everything about how this printer is configured. In practice you will probably end up sending a whole list of Escape Sequences to get this right.

Last edited by methyl; 12-19-2011 at 10:09 AM..
This User Gave Thanks to methyl For This Post:
# 4  
Old 12-22-2011
Thanks guys for the reply. I am using HP-UX 11i V3.

The printer is configured in a Windows XP machine and remotely connected to unix server.There is no HP DirectBox(Windows machine acts as one).

The printer is remotely connected to the LPD port.

No special driver from Epson. It's just the same HP - UX remote printer driver.
# 5  
Old 12-22-2011
Configured as a remote printer, the HP-UX knows nothing about the printer except its hostname (or IP...), therefore ignores all options you would try to send... (man lp and specially 1m rlp ...).
I did long ago (>10 years...) configure a laserjet in such a way, so I know you could "encapsulate" PCL in the file to print but would an Epson accept the HP PCL?
This User Gave Thanks to vbe For This Post:
# 6  
Old 12-22-2011
I hope it's a kind of a no.Smilie . But i would like to try that option instead of thinking . Can you please let me know how to encapsulate PCL into the file.

You mean to say through some escape codes like <FF><DC2> .
# 7  
Old 12-22-2011
The easiest would be to write a script that would parse the give lp option, create the PCL sequence and put that in head of a new file, append the the to print perhaps rename the final file in /tmp and send that to the spool...
some sequences:
Code:
LANDSCAPE="^[&l1O"
WRAP="^[&s0C"
SMALL="^[(s16.66h7V"
2SIDES="^[&l1S"
MARGIN="^[&a"
NOLOGO="^[&f1y8X"
RESET="^[E"
BIGCHAR="^[(s1p16v0b4148T"
DEFLT_FNT="^[(8U^[(s0p12h10v0s0b3T"
BEGIN="^[&l26A"


Or create a string sequence to send to the printer, then send the files to print, then reset the printer...

Last edited by vbe; 12-22-2011 at 09:45 AM.. Reason: added more sequences...
This User Gave Thanks to vbe For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

Setting up printer in AIX 6.1

Hi All, I have been trying to configure an HP laserjet printer on an AIX6.1 server through network as well as remote. This is the first time i am configuring a printer on AIX. I had been using smitty butwhile configuring, i am getting blank/stuck at "software to support the printer attachment... (10 Replies)
Discussion started by: Rockyc3400
10 Replies

2. Shell Programming and Scripting

How to check if printer is out of paper using perl script ?

Hello, I need to chack if the printer is out of paper, and send message to operator. I need to do this from perl script. The printer have mechanism to check if it have paper. However, the cups does not report "printer out of paper" when I remove the paper, and try to print. Is there any... (1 Reply)
Discussion started by: +Yan
1 Replies

3. UNIX for Dummies Questions & Answers

Setting Printer margins

Hi, I have Aix 6.1. Installed the Ricoh Unix print filter, to allow us to print to a Ricoh 5001. So I send text documents to the printer using the qprt command and set the print job finishing options using the Ricoh commands passed using -o options. Eg. qprt -Pfin200 -o collate=on -o text... (7 Replies)
Discussion started by: max5000
7 Replies

4. UNIX for Advanced & Expert Users

Printer setting in Solaris

I have Solaris-10 server and want to change default printer setting to Simplex (Instead of duplex, which is set currently). I am not able to see anything in conf file related to this setting. Please help (2 Replies)
Discussion started by: solaris_1977
2 Replies

5. Emergency UNIX and Linux Support

Change printer setting

I have Solaris-10 server and want to change default printer setting to Simplex (Instead of duplex, which is set currently). I am not able to see anything in conf file related to this setting. Please help. (1 Reply)
Discussion started by: solaris_1977
1 Replies

6. AIX

Setting up Printer

Hi All, This is katherine and I am kind of new to AIX and has got the following request to set up the printer. Can anybody guide me to fullfill the following request step by step. The request is as follows: "We have been asked to set up the following printer in Oracle: UNIX queue ... (1 Reply)
Discussion started by: katherine2008
1 Replies

7. AIX

Setting up Local printer AIX 5

Hi folks need some help here. We have a RS6000 running AIX. It is almost never used anymore, but we need to print off some data. I have a paralell printer conected to the parrallel port, but have no idea where to go from here. The printer was originall named named LP01. If the users telnetinto the... (2 Replies)
Discussion started by: prator
2 Replies

8. UNIX for Dummies Questions & Answers

Setting a HP printer under Solaris 9

Hello. I am trying to make work HP printer Deskjet 692C. I have Solaris 9 x86. I tried to use admintool: I choosed 'HP-printer' and 'Postscript filter' options. When I want to print something, instead of the text, the printer prints many pages of some kind of code or whatever... ... (1 Reply)
Discussion started by: Peter123456789
1 Replies

9. UNIX for Dummies Questions & Answers

setting up a network printer

Hello people, I'm attempting to setup a printer connection to a printer running off the NT printer server, but with little success. I'm using the admintool, go to ADD printers...where it offers 'local' and 'access to printer'. I have chosen the 'access to printer' option as i'm attempting to... (1 Reply)
Discussion started by: colesy
1 Replies
Login or Register to Ask a Question