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.
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
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
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
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?
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":
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.
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?
I hope it's a kind of a no. . 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> .
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:
How is the Windows printer configured? Does it have the Epson driver loaded and a configuration screen where you can change the page size? Or is it just configured as a dumb network printer?
Diagnostics:
Your printer should have a diagnostic mode where it prints all escape sequences rather than executing them. This is one way to find out if Windows is sending setup escape sequences to the printer - and what they are.
You should also add an additional escape sequence to return the printer to its power on settings at the end of the job, otherwise, every job will have to set its own page length.
Try setting the printer as a Generic text only printer within XP so that the Windows driver does not add additional escape sequences.
EPSON LQ 680 / ESC P2 driver is loaded and i am able to change the page size . Infact i am able to see lots of options. Have tried over different sizes like A4,A5 Letter , etc . Also in the printer DIP settings i am able to set the printer page length and other options like Perforation , etc. Have changed and tried all those combinations. But was still unsuccessful.
---------- Post updated at 07:52 PM ---------- Previous update was at 06:59 PM ----------
Looks like it is reading the escape sequence as "Esc C !" (i.e. taking octal 041 to mean character ! - not decimal 33).
Time to get hold of the manual for your printer. The first thing to check is what mode the printer is in.
(My codes came from an Epson LQ850+ manual and were used in a live script to print awkward sized labels).
I have had terrible trouble with this subject in the past because Epson marketed some printer model variants which responded to non-Epson control codes. (e.g. IBM codes) while they were trying to get market share. You can only tell from the part number.
Sorry but this question makes no sense whatsever. There is no such thing as a "LPR port".
Get the manual for your printer and find out how to put the printer into diagnostic mode where it will print any Escape Sequences rather than action them.
There is a massive difference when a Microsoft Windows computer is involved. Personally I have not configured a "LPR" printer in the last 20 years (it is very old technology).
Nowadays we expect the printer to be directly connected to the network. When it is an old dot-matrix printer we expect it to be connected to the network via a HP Jet Direct box.
Merry Christmas Guys. Still i have alignment issues in printing. Will update the post once i get the solution. Any other suggestions please help. Thanks
confirm that file set33 contains 3 characters using a hex or octal dump program. Hex dump should look like 1b 43 21.
Do the same with the printer reset.
echo "\0033@\c">reset
If you have the gnu version of echo, will you have to use "echo -e" instead of "echo"
Change the unix printer script to:
cat set33 myprintfile reset |lp -depson
Change the Windows printer configuration to temporarily print to file. Send a print job to the printer, and examine the file using "debug"
Are there also escape sequences in the original print file? If so they will override whatever commands you prefix the file with. Can you save the original print file, and post the first 3 lines, and the last 3 lines?
Lets bypass all the intermediate processes.
Save the print file to disk.
Edit the file so that only two pages are printed.
cat set33 saved_print_file reset >testfile
Go to the XP machine.
Start a command prompt
FTP to the HPUX machine and login.
ftp>ascii
ftp>get testfile
ftp>quit
c:> copy testfile LPT1:
I am assuming that the printer is connected to the primary parallel port of the computer. Otherwise, use the appropriate device (LPT2:, COM1:, COM2:)
It is connected to a USB port . When i mention USB002(name of the port to which printer is configured) it is giving me an error( * Is not a recognized device). When i give the printer name instead of port name it is asking whether to overwrite the file with options as Yes /No/All . I have a doubt wherein it will overwrite any printer settings or just the datas in printer queue . (Coz the printer queue is empty right now and then also it is aking the same)