Operating System - HP-UX
1834601 Members
3725 Online
110069 Solutions
New Discussion

Re: First line prints to the left. The rest prints ok.

 
John Town
Advisor

First line prints to the left. The rest prints ok.

Hi,

We have a Xerox printer configured in our rx4640. We configured the printer and everything except the first line prints ok. Example:

Lucy Olivo
PO Box 3338
Puerto Rico

Should be

Lucy Olivo
PO Box 3338
Puerto Rico

These are the PCLs used:

port="${ESC}&l0O"
land="${ESC}&l1O"
landCond="${ESC}&l1O${ESC}&l5.7C${ESC}&l2E${ESC}&l66F${ESC}&k10H${
ESC}&a0L"
portCond="${ESC}&l0O${ESC}&l5.7C${ESC}&l2E${ESC}&l132F${ESC}&k10H${
ESC}&a0L"
courierBoldCond="${ESC}(${ESC}(s0p17h0s3b4099T"
courierBold="${ESC}(${ESC}(s0p12h0s3b4099T"
simplex="${ESC}&l0S"
duplex="${ESC}&l1S"
duplexTumble="${ESC}&l2S"

I don't know where to fix the problem in the file. Has any one seen this?
8 REPLIES 8
Bill Hassell
Honored Contributor

Re: First line prints to the left. The rest prints ok.

You're missing the most important part: how do you use those escape sequences? The problem is with the codes in front of the first line which the printer isn't showing. Since there is probably a bunch of software between the name/address text and the printer, you'll need to somehow capture the print stream into a file. If you use the lp spooler, simply disable the printer then print a sampl job. The text to be sent to the printer is now in the directory /var/spool/lp/request under the name of the printer. The c--- file is the control file while the d--- file is the data for the printer. Display the data in hex like this:

xd -xc dA0004hpd370

You will then see the printable characters as well as the codes for the escape sequences. The codes must be exact - fonts can make the i l 1 characters very easy to misinterpret.

Since you now have the data file, it's possible to edit the file to remove or change the codes until it prints correctly.


Bill Hassell, sysadmin
John Town
Advisor

Re: First line prints to the left. The rest prints ok.

I did the command # xd -xc dfA101vmap1prd and this was displayed. Are the 4 digit numbers the escape sequences? How can I associate them with the codes of the queue?

0000000 2020 204a 5541 4e20 2020 2020 2020 2020
J U A N
0000010 2020 2020 2020 2320 3030 3337 3739 3020
# 0 0 3 7 7 9 0
0000020 5320 2020 2020 2020 2020 2020 2020 2020
S
0000030 2020 2020 2020 4149 4441 204c 555a 2020
A I D A L U Z
0000040 2020 2020 2020 2020 2023 2030 3037 3234
# 0 0 7 2 4
0000050 3435 2053 0a20 2020 524f 4452 4947 5545
4 5 S \n R O D R I G U E
0000060 5a20 2020 2020 2020 5045 5245 5a20 2020
Z P E R E Z
0000070 2020 2020 2020 2020 2020 2020 2020 2020

0000080 2020 2020 2020 2020 2020 2048 4552 4e41
H E R N A
0000090 4e44 455a 2020 2020 2020 204d 454c 454e
N D E Z M E L E N
00000a0 4445 5a20 2020 2020 2020 0a20 2020 2020
D E Z \n
00000b0 2020 2020 2020 2020 2020 2020 2020 2020

*
00000e0 204d 3131 2055 5242 204a 4553 5553 204d
M 1 1 U R B J E S U S M
00000f0 204c 4147 4f20 2020 2020 0a20 2020 504f
L A G O \n P O
0000100 2042 4f58 2038 3132 2020 2020 2020 2020
B O X 8 1 2
0000110 2020 2020 2020 2020 2020 2020 2020 2020

*
0000140 2020 2020 2020 2020 2020 0a20 2020 4c41
\n L A
0000150 5245 5320 5052 2020 2020 2020 2020 2020
R E S P R
0000160 2020 2020 3030 3636 3920 2020 2020 2020
0 0 6 6 9
0000170 2020 2020 2020 2020 2020 2020 2020 2020

0000180 2055 5455 4144 4f20 5052 2020 2020 2020
U T U A D O P R
0000190 2020 2020 2020 2030 3036 3431 2020 2020
0 0 6 4 1
00001a0 200a 2020 2020 0a20 2020 4e41 4e43 5920
\n \n N A N C Y
00001b0 2020 2020 2020 2020 2020 2020 2023 2030
# 0
00001c0 3133 3532 3033 2053 2020 2020 2020 2020
1 3 5 2 0 3 S
00001d0 2020 2020 2020 2020 2020 2020 204a 4f53
J O S
00001e0 4520 2020 2020 2020 2020 2020 2020 2020
E
00001f0 2320 3032 3034 3934 3320 530a 2020 2042
# 0 2 0 4 9 4 3 S \n B
0000200 4f4e 494c 4c41 2020 2020 2020 2020 2049
O N I L L A I
0000210 5249 5a41 5252 5920 2020 2020 2020 2020
R I Z A R R Y
0000220 2020 2020 2020 2020 2020 2020 2020 2020

0000230 2020 5341 4e54 4941 474f 2020 2020 2020
S A N T I A G O
0000240 2020 5249 4f53 2020 2020 2020 2020 2020
R I O S
0000250 200a 2020 2020 2020 2020 2020 2020 2020
\n
0000260 2020 2020 2020 2020 2020 2020 2020 2020

*
0000280 2020 2020 2020 2020 424f 5820 3836 2020
B O X 8 6
0000290 2020 2020 2020 2020 2020 2020 2020 2020

00002a0 200a 2020 2048 4320 3220 424f 5820 2336
\n H C 2 B O X # 6
00002b0 3431 3120 2020 2020 2020 2020 2020 2020
4 1 1
00002c0 2020 2020 2020 2020 2020 2020 2020 2020

00002d0 2020 2020 2020 2020 414e 4745 4c45 5320
A N G E L E S
00002e0 2020 2020 2020 2020 2020 2020 2020 2020

00002f0 200a 2020 2041 444a 554e 5441 5320 5052
\n A D J U N T A S P R
0000300 2020 2020 2020 2020 2020 2030 3036 3031
0 0 6 0 1
0000310 2020 2020 2020 2020 2020 2020 2020 2020

0000320 2020 2020 2020 2020 5554 5541 444f 2050
U T U A D O P
0000330 5220 2020 2020 2020 2020 2020 2020 3030
R 0 0
0000340 3634 3120 2020 2020 0a20 2020 200a 2020
6 4 1 \n \n
0000350 2050 4544 524f 2020 2020 2020 2020 2020
P E D R O
0000360 2020 2020 2320 3032 3733 3834 3920 5320
# 0 2 7 3 8 4 9 S
0000370 2020 2020 2020 2020 2020 2020 2020 2020

0000380 2020 2020 4155 4441 4c49 2020 2020 2020
A U D A L I
0000390 2020 2020 2020 2023 2030 3334 3630 3234
# 0 3 4 6 0 2 4
00003a0 2053 0a20 2020 4341 5244 4f4e 4120 2020
S \n C A R D O N A
00003b0 2020 2020 2020 4151 5549 4e4f 2020 2020
A Q U I N O
00003c0 2020 2020 2020 2020 2020 2020 2020 2020

00003d0 2020 2020 2020 2020 2054 4f52 5245 5320
T O R R E S
00003e0 2020 2020 2020 2020 2020 2020 2020 2020

00003f0 2020 2020 2020 2020 0a20 2020 2020 2020
\n
0000400 2020 2020 2020 2020 2020 2020 2020 2020

*
0000440 2020 2020 2020 2020 0a20 2020 4843 2030
\n H C 0
0000450 3120 424f 5820 2333 3134 3220 2020 2020
1 B O X # 3 1 4 2
0000460 2020 2020 2020 2020 2020 2020 2020 2020

0000470 2020 2020 2020 2020 2020 2020 2020 2050
P
0000480 4f20 424f 5820 3230 3538 2020 2020 2020
O B O X 2 0 5 8
0000490 2020 2020 2020 2020 0a20 2020 4c41 5245
\n L A R E
00004a0 5320 5052 2020 2020 2020 2020 2020 2020
S P R
00004b0 2020 3030 3636 3920 2020 2020 2020 2020
0 0 6 6 9
00004c0 2020 2020 2020 2020 2020 2020 2020 2055
U
00004d0 5455 4144 4f20 5052 2020 2020 2020 2020
T U A D O P R
00004e0 2020 2020 2030 3036 3431 2020 2020 200a
0 0 6 4 1 \n
00004f0 2020 2020 0a20 2020 4a55 5354 4f20 2020
\n J U S T O
0000500 2020 2020 2020 2020 2020 2023 2030 3431
# 0 4 1
0000510 3631 3731 2053 2020 2020 2020 2020 2020
6 1 7 1 S
0000520 2020 2020 2020 2020 2020 2041 524e 414c
A R N A L
0000530 444f 2020 2020 2020 2020 2020 2020 2320
D O #
0000540 3034 3837 3437 3520 530a 2020 2044 5552
0 4 8 7 4 7 5 S \n D U R
0000550 414e 2020 2020 2020 2020 2020 2020 2020
A N
0000560 2020 2020 2020 2020 2020 2020 2020 2020

*
0000580 4d41 5254 494e 455a 2020 2020 2020 2020
M A R T I N E Z
0000590 4d55 4e49 5a20 2020 2020 2020 2020 200a
M U N I Z \n
00005a0 2020 2032 3020 4c41 5245 5320 4741 5244
2 0 L A R E S G A R D
00005b0 454e 5320 4150 5420 2020 2020 2020 2020
E N S A P T
00005c0 2020 2020 2020 2020 2020 2020 2020 2020

*
00005e0 2020 2020 2020 2020 2020 2020 2020 200a
\n
00005f0 2020 2020 2020 2020 2020 2020 2020 2020

*
0000620 2020 2020 2020 504f 2042 4f58 2037 3532
P O B O X 7 5 2
0000630 2020 2020 2020 2020 2020 2020 2020 200a
\n
0000640 2020 204c 4152 4553 2050 5220 2020 2020
L A R E S P R
0000650 2020 2020 2020 2020 2030 3036 3639 2d33
0 0 6 6 9 - 3
0000660 3130 3220 2020 2020 2020 2020 2020 2020
1 0 2
0000670 2020 2020 2020 4c41 5245 5320 5052 2020
L A R E S P R
0000680 2020 2020 2020 2020 2020 2020 3030 3636
0 0 6 6
0000690 3920 2020 2020 0a20 2020 200a 2020 204e
9 \n \n N
00006a0 454c 534f 4e20 2020 2020 2020 2020 2020
E L S O N
00006b0 2020 2320 3035 3635 3531 3120 5320 2020
# 0 5 6 5 5 1 1 S
00006c0 2020 2020 2020 2020 2020 2020 2020 2020

00006d0 2020 414c 454a 414e 4452 494e 4120 2020
A L E J A N D R I N A
00006e0 2020 2020 2023 2030 3634 3038 3439 2053
# 0 6 4 0 8 4 9 S
00006f0 0a20 2020 524f 4452 4947 5545 5a20 2020
\n R O D R I G U E Z
0000700 2020 2020 4741 4c41 525a 4120 2020 2020
G A L A R Z A
0000710 2020 2020 2020 2020 2020 2020 2020 2020

0000720 2020 2020 2020 204d 414c 444f 4e41 444f
M A L D O N A D O
0000730 2020 2020 2020 2050 4552 455a 2020 2020
P E R E Z
0000740 2020 2020 2020 0a20 2020 2020 2020 2020
\n
0000750 2020 2020 2020 2020 2020 2020 2020 2020

*
0000770 2020 2020 2020 2020 2020 2020 2031 3439
1 4 9
0000780 2042 4441 204c 4120 4752 414e 4a41 2020
B D A L A G R A N J A
0000790 2020 2020 2020 0a20 2020 4c4f 5320 5049
\n L O S P I
00007a0 4e4f 5320 2332 3031 2020 2020 2020 2020
N O S # 2 0 1
00007b0 2020 2020 2020 2020 2020 2020 2020 2020

00007c0 2020 2020 2020 2020 2020 2020 2042 4f20
B O
00007d0 5055 4542 4c4f 2020 2020 2020 2020 2020
P U E B L O
00007e0 2020 2020 2020 0a20 2020 5554 5541 444f
\n U T U A D O
00007f0 2050 5220 2020 2020 2020 2020 2020 2020
P R
0000800 3030 3634 3120 2020 2020 2020 2020 2020
0 0 6 4 1
0000810 2020 2020 2020 2020 2020 2020 2055 5455
U T U
0000820 4144 4f20 5052 2020 2020 2020 2020 2020
A D O P R
0000830 2020 2030 3036 3431 2020 2020 200a 2020
0 0 6 4 1 \n
0000840 2020 0a20 2020 4556 454c 594e 2020 2020
\n E V E L Y N
0000850 2020 2020 2020 2020 2023 2030 3731 3835
# 0 7 1 8 5
0000860 3436 2053 2020 2020 2020 2020 2020 2020
4 6 S
0000870 2020 2020 2020 2020 204d 4152 4741 5249
M A R G A R I
0000880 5441 2020 2020 2020 2020 2020 2320 3037
T A # 0 7
0000890 3933 3431 3420 530a 2020 204d 4159 4f4c
9 3 4 1 4 S \n M A Y O L
00008a0 5920 2020 2020 2020 2020 2052 4f44 5249
Y R O D R I
00008b0 4755 455a 2020 2020 2020 2020 2020 2020
G U E Z
00008c0 2020 2020 2020 2020 2020 2020 2020 504c
P L
00008d0 415a 4120 2020 2020 2020 2020 2020 414c
A Z A A L
00008e0 4943 4541 2020 2020 2020 2020 200a 2020
I C E A \n
00008f0 2020 2020 2020 2020 2020 2020 2020 2020

*
0000920 2020 2020 3134 2056 4547 4120 4445 2050
1 4 V E G A D E P
0000930 5549 4720 2020 2020 2020 2020 200a 2020
U I G \n
0000940 2048 4320 3320 424f 5820 2331 3436 3235
H C 3 B O X # 1 4 6 2 5
0000950 2020 2020 2020 2020 2020 2020 2020 2020

*
0000980 2020 2020 2020 2020 2020 2020 200a 2020
\n
0000990 2055 5455 4144 4f20 5052 2020 2020 2020
U T U A D O P R
00009a0 2020 2020 2020 2030 3036 3431 2020 2020
0 0 6 4 1
00009b0 2020 2020 2020 2020 2020 2020 2020 2020

00009c0 2020 2020 4144 4a55 4e54 4153 2050 5220
A D J U N T A S P R
00009d0 2020 2020 2020 2020 2020 3030 3630 3120
0 0 6 0 1
00009e0 2020 2020 0a20 2020 200a 2020 204d 4947
\n \n M I G
00009f0 4441 4c49 4120 2020 2020 2020 2020 2020
D A L I A
0000a00 2320 3038 3637 3834 3820 5320 2020 2020
# 0 8 6 7 8 4 8 S
0000a10 2020 2020 2020 2020 2020 2020 2020 2020

0000a20 424c 414e 4341 2020 2020 2020 2020 2020
B L A N C A
0000a30 2020 2023 2030 3934 3432 3039 2053 0a20
# 0 9 4 4 2 0 9 S \n
0000a40 2020 5649 5255 4554 2020 2020 2020 2020
V I R U E T
0000a50 2020 5041 424f 4e20 2020 2020 2020 2020
P A B O N
0000a60 2020 2020 2020 2020 2020 2020 2020 2020

0000a70 2020 2020 204d 4552 4341 444f 2020 2020
M E R C A D O
0000a80 2020 2020 2043 4f52 5445 5320 2020 2020
C O R T E S
0000a90 2020 2020 0a20 2020 2020 2020 2020 2020
\n
0000aa0 2020 2020 2020 2020 2020 2020 2020 2020

*
0000ac0 2020 2020 2020 2020 2020 2055 5242 2053
U R B S
0000ad0 414e 204a 4f41 5155 494e 2020 2020 2020
A N J O A Q U I N
0000ae0 2020 2020 0a20 2020 4843 2031 2042 4f58
\n H C 1 B O X
0000af0 2023 3533 3037 2020 2020 2020 2020 2020
# 5 3 0 7
0000b00 2020 2020 2020 2020 2020 2020 2020 2020

0000b10 2020 2020 2020 2020 2020 2034 3020 4341
4 0 C A
0000b20 4c4c 4520 4c55 4953 2042 4152 544f 4c20
L L E L U I S B A R T O L
0000b30 2020 2020 0a20 2020 4a41 5955 5941 2050
\n J A Y U Y A P
0000b40 5220 2020 2020 2020 2020 2020 2020 3030
R 0 0
0000b50 3636 3420 2020 2020 2020 2020 2020 2020
6 6 4
0000b60 2020 2020 2020 2020 2020 2041 444a 554e
A D J U N
0000b70 5441 5320 5052 2020 2020 2020 2020 2020
T A S P R
0000b80 2030 3036 3031 2d32 3331 370a 2020 2020
0 0 6 0 1 - 2 3 1 7 \n
0000b90 0a20 2020 454c 495a 4142 4554 4820 2020
\n E L I Z A B E T H
0000ba0 2020 2020 2020 2023 2031 3032 3036 3539
# 1 0 2 0 6 5 9
0000bb0 2053 2020 2020 2020 2020 2020 2020 2020
S
0000bc0 2020 2020 2020 204c 5549 5320 4d41 4e55
L U I S M A N U
0000bd0 454c 2020 2020 2020 2020 2320 3130 3934
E L # 1 0 9 4
0000be0 3739 3920 530a 2020 2043 5255 5a20 2020
7 9 9 S \n C R U Z
0000bf0 2020 2020 2020 2020 204e 4f56 414c 4553
N O V A L E S
0000c00 2020 2020 2020 2020 2020 2020 2020 2020

0000c10 2020 2020 2020 2020 2020 2020 4455 5241
D U R A
0000c20 4e20 2020 2020 2020 2020 2020 5645 4c45
N V E L E
0000c30 5a20 2020 2020 2020 2020 200a 2020 2020
Z \n
0000c40 2020 2020 2020 2020 2020 2020 2020 2020

*
0000c70 2020 504f 2042 4f58 2035 3930 2020 2020
P O B O X 5 9 0
0000c80 2020 2020 2020 2020 2020 200a 2020 2050
\n P
0000c90 4f20 424f 5820 3130 3733 2020 2020 2020
O B O X 1 0 7 3
0000ca0 2020 2020 2020 2020 2020 2020 2020 2020

*
0000cd0 2020 2020 2020 2020 2020 200a 2020 204c
\n L
0000ce0 4152 4553 2050 5220 2020 2020 2020 2020
A R E S P R
0000cf0 2020 2020 2030 3036 3639 2020 2020 2020
0 0 6 6 9
0000d00 2020 2020 2020 2020 2020 2020 2020 2020

0000d10 2020 4c41 5245 5320 5052 2020 2020 2020
L A R E S P R
0000d20 2020 2020 2020 2020 3030 3636 392d 2035
0 0 6 6 9 - 5
0000d30 3930 0a20 2020 200a 2020 2041 4e47 454c
9 0 \n \n A N G E L
0000d40 204c 5549 5320 2020 2020 2020 2020 2320
L U I S #
0000d50 3131 3731 3632 3720 5320 2020 2020 2020
1 1 7 1 6 2 7 S
0000d60 2020 2020 2020 2020 2020 2020 2020 4341
C A
0000d70 524c 4f53 2020 2020 2020 2020 2020 2020
R L O S
0000d80 2023 2031 3234 3633 3831 2053 0a20 2020
# 1 2 4 6 3 8 1 S \n
0000d90 5155 494e 4f4e 455a 2020 2020 2020 2020
Q U I N O N E Z
0000da0 4e45 4752 4f4e 2020 2020 2020 2020 2020
N E G R O N
0000db0 2020 2020 2020 2020 2020 2020 2020 2020

0000dc0 2020 2042 4152 5245 4952 4f20 2020 2020
B A R R E I R O
0000dd0 2020 2053 4552 5241 4e4f 2020 2020 2020
S E R R A N O
0000de0 2020 0a20 2020 504f 2042 4f58 2035 3733
\n P O B O X 5 7 3
0000df0 2020 2020 2020 2020 2020 2020 2020 2020

*
0000e10 2020 2020 2020 2020 204f 3137 2055 5242
O 1 7 U R B
0000e20 204a 4553 5553 204d 204c 4147 4f20 2020
J E S U S M L A G O
0000e30 2020 0a20 2020 2020 2020 2020 2020 2020
\n
0000e40 2020 2020 2020 2020 2020 2020 2020 2020

*
0000e80 2020 0a20 2020 5554 5541 444f 2050 5220
\n U T U A D O P R
0000e90 2020 2020 2020 2020 2020 2020 3030 3634
0 0 6 4
0000ea0 3120 2020 2020 2020 2020 2020 2020 2020
1
0000eb0 2020 2020 2020 2020 2055 5455 4144 4f20
U T U A D O
0000ec0 5052 2020 2020 2020 2020 2020 2020 2030
P R 0
0000ed0 3036 3431 2020 2020 200a 2020 2020 0a20
0 6 4 1 \n \n
0000ee0 2020 434c 4152 4120 2020 2020 2020 2020
C L A R A
0000ef0 2020 2020 2023 2031 3332 3234 3430 2053
# 1 3 2 2 4 4 0 S
0000f00 2020 2020 2020 2020 2020 2020 2020 2020

0000f10 2020 2020 2057 414e 4441 4c49 5320 2020
W A N D A L I S
0000f20 2020 2020 2020 2020 2320 3134 3030 3533
# 1 4 0 0 5 3
0000f30 3420 530a 2020 2042 454c 5452 414e 2020
4 S \n B E L T R A N
0000f40 2020 2020 2020 2056 4547 4120 2020 2020
V E G A
0000f50 2020 2020 2020 2020 2020 2020 2020 2020

0000f60 2020 2020 2020 2020 2020 5245 5945 5320
R E Y E S
0000f70 2020 2020 2020 2020 2020 4f52 5449 5a20
O R T I Z
0000f80 2020 2020 2020 2020 200a 2020 2050 4f20
\n P O
0000f90 424f 5820 3135 3834 2020 2020 2020 2020
B O X 1 5 8 4
0000fa0 2020 2020 2020 2020 2020 2020 2020 2020

*
0000fc0 4843 2031 2042 4f58 2035 3134 3920 2020
H C 1 B O X 5 1 4 9
0000fd0 2020 2020 2020 2020 200a 2020 2020 2020
\n
0000fe0 2020 2020 2020 2020 2020 2020 2020 2020

*
0001020 2020 2020 2020 2020 200a 2020 204c 4152
\n L A R
0001030 4553 2050 5220 2020 2020 2020 2020 2020
E S P R
0001040 2020 2030 3036 3639 2d31 3538 3420 2020
0 0 6 6 9 - 1 5 8 4
0001050 2020 2020 2020 2020 2020 2020 2020 2020

0001060 4144 4a55 4e54 4153 2050 5220 2020 2020
A D J U N T A S P R
0001070 2020 2020 2020 3030 3630 3120 2020 2020
0 0 6 0 1
0001080 0a20 2020 200a 2020 204a 5541 4e20 2020
\n \n J U A N
0001090 2020 2020 2020 2020 2020 2020 2320 3134
# 1 4
00010a0 3739 3233 3020 5320 2020 2020 2020 2020
7 9 2 3 0 S
00010b0 2020 2020 2020 2020 2020 2020 4149 4441
A I D A
00010c0 204c 555a 2020 2020 2020 2020 2020 2023
L U Z #
00010d0 2031 3535 3538 3739 2053 0a20 2020 474f
1 5 5 5 8 7 9 S \n G O
00010e0 4e5a 414c 455a 2020 2020 2020 2020 4152
N Z A L E Z A R
00010f0 4345 2020 2020 2020 2020 2020 2020 2020
C E
0001100 2020 2020 2020 2020 2020 2020 2020 2020

0001110 204d 4552 4341 444f 2020 2020 2020 2020
M E R C A D O
0001120 2043 4f4c 4f4e 2020 2020 2020 2020 2020
C O L O N
0001130 0a20 2020 3435 2043 414c 4c45 204d 554e
\n 4 5 C A L L E M U N
0001140 4f5a 2052 4956 4552 2020 2020 2020 2020
O Z R I V E R
0001150 2020 2020 2020 2020 2020 2020 2020 2020

*
0001180 0a20 2020 2020 2020 2020 2020 2020 2020
\n
0001190 2020 2020 2020 2020 2020 2020 2020 2020

*
00011d0 0a20 2020 4c41 5245 5320 5052 2020 2020
\n L A R E S P R
00011e0 2020 2020 2020 2020 2020 3030 3636 3920
0 0 6 6 9
00011f0 2020 2020 2020 2020 2020 2020 2020 2020

0001200 2020 2020 2020 204c 4152 4553 2050 5220
L A R E S P R
0001210 3036 2050 5220 2020 2020 2020 2030 3037
0 6 P R 0 0 7
0001220 3935 2020 2020 200a 2020 2020 0a20 2020
9 5 \n \n
0001230 4149 4441 2020 2020 2020 2020 2020 2020
A I D A
0001240 2020 2023 2031 3633 3537 3337 2053 2020
# 1 6 3 5 7 3 7 S
0001250 2020 2020 2020 2020 2020 2020 2020 2020

0001260 2020 2041 4e47 454c 2049 5352 4145 4c20
A N G E L I S R A E L
0001270 2020 2020 2020 2320 3137 3138 3435 3720
# 1 7 1 8 4 5 7
0001280 530a 2020 2056 414c 4c45 2020 2020 2020
S \n V A L L E
0001290 2020 2020 2050 4552 455a 2020 2020 2020
P E R E Z
00012a0 2020 2020 2020 2020 2020 2020 2020 2020

00012b0 2020 2020 2020 2020 5445 4c4c 4144 4f20
T E L L A D O
00012c0 2020 2020 2020 2020 414c 4943 4541 2020
A L I C E A
00012d0 2020 2020 2020 200a 2020 2020 2020 2020
\n
00012e0 2020 2020 2020 2020 2020 2020 2020 2020

*
0001300 2020 2020 2020 2020 2020 2020 2020 424f
B O
0001310 5820 3137 3320 2020 2020 2020 2020 2020
X 1 7 3
0001320 2020 2020 2020 200a 2020 2048 4320 3031
\n H C 0 1
0001330 2042 4f58 2033 3639 3520 2020 2020 2020
B O X 3 6 9 5
0001340 2020 2020 2020 2020 2020 2020 2020 2020

0001350 2020 2020 2020 2020 2020 2020 2020 4156
A V
0001360 4520 4c4f 5320 5041 5452 494f 5441 5320
E L O S P A T R I O T A S
0001370 2020 2020 2020 200a 2020 204c 4152 4553
\n L A R E S
0001380 2050 5220 2020 2020 2020 2020 2020 2020
P R
0001390 2030 3036 3639 2020 2020 2020 2020 2020
0 0 6 6 9
00013a0 2020 2020 2020 2020 2020 2020 2020 4c41
L A
00013b0 5245 5320 5052 2020 2020 2020 2020 2020
R E S P R
00013c0 2020 2020 3030 3636 3920 2020 2020 0a20
0 0 6 6 9 \n
00013d0 2020 200a 2020 2052 5542 454e 204f 4d41
\n R U B E N O M A
00013e0 5220 2020 2020 2020 2020 2320 3137 3938
R # 1 7 9 8
00013f0 3732 3420 5320 2020 2020 2020 2020 2020
7 2 4 S
0001400 2020 2020 2020 2020 2020 444f 5241 2020
D O R A
0001410 2020 2020 2020 2020 2020 2020 2023 2031
# 1
0001420 3838 3031 3235 2053 0a20 2020 4352 4553
8 8 0 1 2 5 S \n C R E S
0001430 504f 2020 2020 2020 2020 2020 524f 4452
P O R O D R
0001440 4947 5545 5a20 2020 2020 2020 2020 2020
I G U E Z
0001450 2020 2020 2020 2020 2020 2020 2020 2054
T
0001460 4f52 5245 5320 2020 2020 2020 2020 2056
O R R E S V
0001470 4952 5545 5420 2020 2020 2020 2020 0a20
I R U E T \n
0001480 2020 3133 3220 5045 4452 4f20 4120 4341
1 3 2 P E D R O A C A
0001490 4d50 4f53 2020 2020 2020 2020 2020 2020
M P O S
00014a0 2020 2020 2020 2020 2020 2020 2020 2020

*
00014c0 2020 2020 2020 2020 2020 2020 2020 0a20
\n
00014d0 2020 2020 2020 2020 2020 2020 2020 2020

*
0001500 2020 2020 2050 4f20 424f 5820 3133 3420
P O B O X 1 3 4
0001510 2020 2020 2020 2020 2020 2020 2020 0a20
\n
0001520 2020 4c41 5245 5320 5052 2020 2020 2020
L A R E S P R
0001530 2020 2020 2020 2020 3030 3636 3920 2020
0 0 6 6 9
0001540 2020 2020 2020 2020 2020 2020 2020 2020

0001550 2020 2020 2055 5455 4144 4f20 5052 2020
U T U A D O P R
0001560 2020 2020 2020 2020 2020 2030 3036 3431
0 0 6 4 1
0001570 2020 2020 200a 2020 2020 0a20 2020 4d41
\n \n M A
0001580 4e55 454c 2020 2020 2020 2020 2020 2020
N U E L
0001590 2023 2031 3936 3132 3431 2053 2020 2020
# 1 9 6 1 2 4 1 S
00015a0 2020 2020 2020 2020 2020 2020 2020 2020

00015b0 2043 4152 4d45 4e20 2020 2020 2020 2020
C A R M E N
00015c0 2020 2020 2320 3230 3434 3934 3420 530a
# 2 0 4 4 9 4 4 S \n
00015d0 2020 2043 5255 5a20 2020 2020 2020 2020
C R U Z
00015e0 2020 2042 4f52 4745 5320 2020 2020 2020
B O R G E S
00015f0 2020 2020 2020 2020 2020 2020 2020 2020

0001600 2020 2020 2020 504c 415a 4120 2020 2020
P L A Z A
0001610 2020 2020 2020 4143 4556 4544 4f20 2020
A C E V E D O
0001620 2020 2020 200a 2020 2055 5242 204a 4152
\n U R B J A R
0001630 4449 4e45 5320 4445 204c 4152 4520 2020
D I N E S D E L A R E
0001640 2020 2020 2020 2020 2020 2020 2020 2020

0001650 2020 2020 2020 2020 2020 2020 504f 2042
P O B
0001660 4f58 2034 3938 2020 2020 2020 2020 2020
O X 4 9 8
0001670 2020 2020 200a 2020 2034 2043 414c 4c45
\n 4 C A L L E
0001680 2041 2020 2020 2020 2020 2020 2020 2020
A
0001690 2020 2020 2020 2020 2020 2020 2020 2020

*
00016c0 2020 2020 200a 2020 204c 4152 4553 2050
\n L A R E S P
00016d0 5220 2020 2020 2020 2020 2020 2020 2030
R 0
00016e0 3036 3639 2020 2020 2020 2020 2020 2020
0 6 6 9
00016f0 2020 2020 2020 2020 2020 2020 4144 4a55
A D J U
0001700 4e54 4153 2050 5220 2020 2020 2020 2020
N T A S P R
0001710 2020 3030 3630 312d 2034 3938 0a20 2020
0 0 6 0 1 - 4 9 8 \n
0001720 200a 2020 2041 4e47 454c 204d 414e 5545
\n A N G E L M A N U E
0001730 4c20 2020 2020 2020 2320 3231 3237 3230
L # 2 1 2 7 2 0
0001740 3720 5320 2020 2020 2020 2020 2020 2020
7 S
0001750 2020 2020 2020 2020 414e 4745 4c20 2020
A N G E L
0001760 2020 2020 2020 2020 2020 2023 2032 3230
# 2 2 0
0001770 3639 3832 2053 0a20 2020 434f 4e43 4550
6 9 8 2 S \n C O N C E P
0001780 4349 4f4e 2020 2020 2020 2020 2020 2020
C I O N
0001790 2020 2020 2020 2020 2020 2020 2020 2020

00017a0 2020 2020 2020 2020 2020 2020 2056 4552
V E R
00017b0 4120 2020 2020 2020 2020 2020 2056 4547
A V E G
00017c0 4120 2020 2020 2020 2020 2020 0a20 2020
A \n
00017d0 504f 2042 4f58 2033 3233 2020 2020 2020
P O B O X 3 2 3
00017e0 2020 2020 2020 2020 2020 2020 2020 2020

*
0001810 2020 2020 2020 2020 2020 2020 0a20 2020
\n
0001820 2020 2020 2020 2020 2020 2020 2020 2020

*
0001850 2020 2050 4f20 424f 5820 3733 3635 2020
P O B O X 7 3 6 5
0001860 2020 2020 2020 2020 2020 2020 0a20 2020
\n
0001870 5554 5541 444f 2050 5220 2020 2020 2020
U T U A D O P R
0001880 2020 2020 2020 3030 3634 3120 2020 2020
0 0 6 4 1
0001890 2020 2020 2020 2020 2020 2020 2020 2020

00018a0 2020 2055 5455 4144 4f20 5052 2020 2020
U T U A D O P R
00018b0 2020 2020 2020 2020 2030 3036 3431 2020
0 0 6 4 1
00018c0 2020 200a 2020 2020 0a20 2020 4c55 4953
\n \n L U I S
00018d0 4120 2020 2020 2020 2020 2020 2020 2023
A #
00018e0 2032 3332 3536 3135 2053 2020 2020 2020
2 3 2 5 6 1 5 S
00018f0 2020 2020 2020 2020 2020 2020 2020 2020

*
0001910 2020 2320 3030 3030 3030 3020 200a 2020
# 0 0 0 0 0 0 0 \n
0001920 2053 414e 5449 4147 4f20 2020 2020 2020
S A N T I A G O
0001930 2041 4e44 494e 4f20 2020 2020 2020 2020
A N D I N O
0001940 2020 2020 2020 2020 2020 2020 2020 2020

*
0001970 2020 200a 2020 2020 2020 2020 2020 2020
\n
0001980 2020 2020 2020 2020 2020 2020 2020 2020

*
00019c0 2020 200a 2020 2048 4320 3220 424f 5820
\n H C 2 B O X
00019d0 2337 3931 3920 2020 2020 2020 2020 2020
# 7 9 1 9
00019e0 2020 2020 2020 2020 2020 2020 2020 2020

*
0001a10 2020 200a 2020 204a 4159 5559 4120 5052
\n J A Y U Y A P R
0001a20 2020 2020 2020 2020 2020 2020 2030 3036
0 0 6
0001a30 3634 2020 2020 2020 2020 2020 2020 2020
6 4
0001a40 2020 2020 2020 2020 2020 2020 2020 2020

*
0001a60 3030 3030 3020 2020 2020 0a20 2020 200a
0 0 0 0 0 \n \n
0001a70

Bill Hassell
Honored Contributor

Re: First line prints to the left. The rest prints ok.

The man page for ascii (man ascii) will decode the hex values. Here is the first line:

0000000 2020 204a 5541 4e20 2020 2020 2020 2020
J U A N

0000000 is the line number
20 is hex for space so 2020 is two spaces. 204a is a space and the letter J. 5541 is UA and 4e20 is N plus a space. The rest of the line is all spaces. This isn't the example you showed above but there are no escape sequences at all in the test you posted.

FYI, an escape sequence such as $port in your example would show in hex as 1b26 6c30 4f which is ESC & l 0 O (that's lowercase l, zero and capital O). There are no escape sequences at all in the listing you posted.


Bill Hassell, sysadmin
John Town
Advisor

Re: First line prints to the left. The rest prints ok.

Hi Again,

I decoded the spool file and everything looks fine. 202020 are the 3 spaces that are supposed to be before printing it. The problem is when the printer receives the spool file.

This is the file of the queue created for the printer. I don't know which one is telling the device to start printing to the left in the first line.


[root@vmap1prd /var/spool/lp/interface]# more TEST
#!/usr/bin/sh
#
# Programmer: William R. Seppeler
# File: xrxDcsOption
# Version: 1.1
# Date: 11/13/96
#
# Copyright 1996, Xerox Corporation
#
#
# This model is a slight variation of the "rmodel" script that was
# provided with the base HP-UX operating system.
#
####################################################################
# Additional Modifications by Gary Ames

printer=`basename $0`
rlp="/usr/sbin/rlp"

if [ ! -x $rlp ]
then
disable -r"can't execute $rlp filter" $printer
exit 1
fi

ESC='^['
reset="${ESC}E"

##############################################################
##############################################################
# Changed &k3G to &k2G in case files already have CR Gary Ames
initialize="${ESC}&k3G"
file=$6

###################################################################
###################################################################
###################################################################
# This section modified by Gary Ames for Selection of Options


port="${ESC}&l0O"
land="${ESC}&l1O"
landCond="${ESC}&l1O${ESC}&l5.7C${ESC}&l2E${ESC}&l66F${ESC}&k10H${ESC}&a0L"
portCond="${ESC}l0O${ESC}&l5.7C${ESC}&l2E${ESC}&l132F${ESC}&k10H${ESC}&a0L"
courierBoldCond="${ESC}(${ESC}(s0p17h0s3b4099T"
courierBold="${ESC}(0N${ESC}(s0ps12hs0b4099T"
simplex="${ESC}&l0S"
duplex="${ESC}&l1S"
duplexTumble="${ESC}&l2S"

orient="$port"
font="$courierBold"
sides="$simplex"

##################################################################
##################################################################



requestid=$1
BSDC=""
BSDJ=""
BSDT=""
BSDi=""
BSD1=""
BSD2=""
BSD3=""
BSD4=""
BSDw=""
BSDformat=""
BSDh=""

# The following options, Portrait, Landscape, LandCond, PortCond,
# Simplex, Duplex and DuplexTumble added by Gary Ames
for i in $5
do
eval ii='`echo $i | sed -e "s/\BSD//g"`'
case "$i" in
p) ## Portrait
orient="$port"
font="$courierBold"
;;
l) ## Landscape
orient="$land"
font="$courierBold"
;;
c) ## Portrait Condensed
orient="$portCond"
font="$courierBoldCond"
;;
lc) ## Landscape Condensed
orient="$landCond"
font="$courierBoldCond"
;;
s) ## Duplex Normal
sides="$simplex"
;;
d) ## Duplex Normal
sides="$duplex"
;;
dt) ## Duplex Tumble
sides="$duplexTumble"
;;
BSDC*) # Specify the job classification.
BSDC=-$ii;;
BSDJ*) # Specify the job name.
BSDJ=-$ii;;
BSDT*) # Specify the title for pr(UTIL) to use.
BSDT=-$ii;;
BSDi*) # Cause the output to be indented.
BSDi=-$ii;;
BSD1*) # Specify a font for font position 1.
BSD1=-$ii;;
BSD2*) # Specify a font for font position 2.
BSD2=-$ii;;
BSD3*) # Specify a font for font position 3.
BSD3=-$ii;;
BSD4*) # Specify a font for font position 4.
BSD4=-$ii;;
BSDw*) # The page width for pr(UTIL).
BSDw=-$ii;;
BSDc) # Files contain data produced by cifplot.
BSDformat=-$ii;;
BSDd) # Files contain data from tex (DVI format).
BSDformat=-$ii;;
BSDf) # Files contain FORTRAN carriage control.
BSDformat=-$ii;;
BSDg) # Files contain plot data from plot routines.
BSDformat=-$ii;;
BSDl) # Files assume no page breaks.
BSDformat=-$ii;;
BSDn) # Files contain data from ditroff.
BSDformat=-$ii;;
BSDp) # Use pr(UTIL) to format the files.
BSDformat=-$ii;;
BSDt) # Files contain data from troff.
BSDformat=-$ii;;
BSDv) # Files contain a raster image.
BSDformat=-$ii;;
BSDk) # Files contain Kerberized data.
BSDformat=-$ii;;
BSDo) # Files contain Postscript data.
BSDformat=-$ii;;
BSDz) # Files contain Palladium print system data.
BSDformat=-$ii;;
nb) # Suppress the printing of the banner page.
BSDh="-h";;
BSDh) # Suppress the printing of the banner page.
BSDh=-$ii;;
esac
done

mv $file ${file}.tmp
exec < ${file}.tmp
read line
case $line in
%!*|%%XRXbegin*|${ESC}[E\*\&\%\(]*)
(echo "$line";cat) > $file;;
*)
(echo $reset$initialize$orient$sides$font"$line";cat;echo $reset
) > $file;;
esac
rm ${6}.tmp

eval "$rlp -I$requestid $BSDC $BSDJ $BSDT $BSDi $BSD1 $BSD2 $BSD3 $BSD4 $BSDw $B
SDformat $BSDh $file"
ret=$?

case $ret in
0)
exit 0;;
*)
disable -r"error $ret returned" $printer
exit 1;;
esac

[root@vmap1prd /var/spool/lp/interface]#

John Town
Advisor

Re: First line prints to the left. The rest prints ok.

Hi Bill,

I think that a carriage return is needed before it starts printing the first line.

Using the last queue file I posted, how do I tell the printer to do just that?
Bill Hassell
Honored Contributor

Re: First line prints to the left. The rest prints ok.

This is going to take a while to figure out. You are printing using rlp to the printer which knows nothing about special printer options. This is a heavily modified version of the HP-UX standard script which copies the print job into a temporary file that contains the required codes. Then rlp is called to print the result. The good news is that you can save the temporary file to see exactly what is being sent to the printer. As far as why one space is missing, you have to guarantee the original data indeed does start with 3 spaces, then look at the temp file which have a bunch of escape sequences. A mistyped escape sequence inside the script will cause the printer to do something unexpected. Debugging this will take a lot of testing. I would try several other options to see if another set of printing options prints the first line correctly. Then change just one option to see which one changes the first line.


Bill Hassell, sysadmin
John Town
Advisor

Re: First line prints to the left. The rest prints ok.

Problem solved. Had to add lines to the script.

#!/usr/bin/sh
#
# Programmer: William R. Seppeler
# File: xrxDcsOption
# Version: 1.1
# Date: 11/13/96
#
# Copyright 1996, Xerox Corporation
#
#
# This model is a slight variation of the "rmodel" script that was
# provided with the base HP-UX operating system.
#
####################################################################
# Additional Modifications by Gary Ames

printer=`basename $0`
rlp="/usr/sbin/rlp"

if [ ! -x $rlp ]
then
disable -r"can't execute $rlp filter" $printer
exit 1
fi

ESC='^['
reset="${ESC}E"

##############################################################
##############################################################
# Changed &k3G to &k2G in case files already have CR Gary Ames
initialize="${ESC}&k2G"
file=$6

###################################################################
###################################################################
###################################################################
# This section modified by Gary Ames for Selection of Options


port="${ESC}&l0O"
land="${ESC}&l1O"
landCond="${ESC}&l1O${ESC}&l5.7C${ESC}&l2E${ESC}&l66F${ESC}&k10H${ESC}&a0L"
portCond="${ESC}l0O${ESC}&l5.7C${ESC}&l2E${ESC}&l132F${ESC}&k10H${ESC}&a0L"
courierBoldCond="${ESC}(0N${ESC}(s0p17h0s3b4099T"
courierBold="${ESC}(0N${ESC}(s0p12h0s3b4099T"
simplex="${ESC}&l0S"
duplex="${ESC}&l1S"
duplexTumble="${ESC}&l2S"

orient="$port"
font="$courierBold"
sides="$simplex"

##################################################################
##################################################################



requestid=$1
BSDC=""
BSDJ=""
BSDT=""
BSDi=""
BSD1=""
BSD2=""
BSD3=""
BSD4=""
BSDw=""
BSDformat=""
BSDh=""

# The following options, Portrait, Landscape, LandCond, PortCond,
# Simplex, Duplex and DuplexTumble added by Gary Ames
for i in $5
do
eval ii='`echo $i | sed -e "s/\BSD//g"`'
case "$i" in
p) ## Portrait
orient="$port"
font="$courierBold"
;;
l) ## Landscape
orient="$land"
font="$courierBold"
;;
c) ## Portrait Condensed
orient="$portCond"
font="$courierBoldCond"
;;
lc) ## Landscape Condensed
orient="$landCond"
font="$courierBoldCond"
;;
s) ## Duplex Normal
sides="$simplex"
;;
d) ## Duplex Normal
sides="$duplex"
;;
dt) ## Duplex Tumble
sides="$duplexTumble"
;;
BSDC*) # Specify the job classification.
BSDC=-$ii;;
BSDJ*) # Specify the job name.
BSDJ=-$ii;;
BSDT*) # Specify the title for pr(UTIL) to use.
BSDT=-$ii;;
BSDi*) # Cause the output to be indented.
BSDi=-$ii;;
BSD1*) # Specify a font for font position 1.
BSD1=-$ii;;
BSD2*) # Specify a font for font position 2.
BSD2=-$ii;;
BSD3*) # Specify a font for font position 3.
BSD3=-$ii;;
BSD4*) # Specify a font for font position 4.
BSD4=-$ii;;
BSDw*) # The page width for pr(UTIL).
BSDw=-$ii;;
BSDc) # Files contain data produced by cifplot.
BSDformat=-$ii;;
BSDd) # Files contain data from tex (DVI format).
BSDformat=-$ii;;
BSDf) # Files contain FORTRAN carriage control.
BSDformat=-$ii;;
BSDg) # Files contain plot data from plot routines.
BSDformat=-$ii;;
BSDl) # Files assume no page breaks.
BSDformat=-$ii;;
BSDn) # Files contain data from ditroff.
BSDformat=-$ii;;
BSDp) # Use pr(UTIL) to format the files.
BSDformat=-$ii;;
BSDt) # Files contain data from troff.
BSDformat=-$ii;;
BSDv) # Files contain a raster image.
BSDformat=-$ii;;
BSDk) # Files contain Kerberized data.
BSDformat=-$ii;;
BSDo) # Files contain Postscript data.
BSDformat=-$ii;;
BSDz) # Files contain Palladium print system data.
BSDformat=-$ii;;
nb) # Suppress the printing of the banner page.
BSDh="-h";;
BSDh) # Suppress the printing of the banner page.
BSDh=-$ii;;
esac
done

mv $file ${file}.tmp
exec < ${file}.tmp
#read line
#case $line in
# %!*|%%XRXbegin*|${ESC}[E\*\&\%\(]*)
# (echo "$line";cat) > $file;;
# *)
# (echo $reset$initialize$orient$sides$font"$line";cat;echo $reset) > $file;;
#esac
#### Lines added to solve problem with First Line disalignment
awk -v res=$reset -v ini=$initialize -v ori=$orient -v side=$sides -v fon=$font '{if (NR == 1) print res""ini""ori""
side""fon""$0; else print}' ${file}.tmp > $file
echo $reset >> $file
rm ${6}.tmp

eval "$rlp -I$requestid $BSDC $BSDJ $BSDT $BSDi $BSD1 $BSD2 $BSD3 $BSD4 $BSDw $BSDformat $BSDh $file"
ret=$?

case $ret in
0)
exit 0;;
*)
disable -r"error $ret returned" $printer
exit 1;;
esac


John Town
Advisor

Re: First line prints to the left. The rest prints ok.

See corrected script