Operating System - HP-UX
1748157 Members
3963 Online
108758 Solutions
New Discussion юеВ

About the Printer Model File and the non-HP printer.

 
SOLVED
Go to solution
paul.lee
Occasional Advisor

About the Printer Model File and the non-HP printer.

Hi all,
I am trying to add a non-HP printer (Ricoh MP C2500) on the HP-UX.
With the following command, I created a remote printer using the hp5000c30 (pcl5 based printer) printer model file, because Ricoh MP C2500 supports PCL5.
#lpadmin -ptest01 -v/dev/null -mhp5000c30 -ocmrcmodel -osmrsmodel -ob3 -ormmpc2500 -orplp

After the printer created, I sent the test file (a plain text file) to the MP C2500 with the following command:
#lp -dtest01 -n1 testfile
But the lp command sent the palin text to the MP C2500 without any PCL5 symbol in the print job.

My question is:
after the model file - hp5000c30 is associated with Ricoh MP C2500, the lp command should transform the print job with the PCL command/symbol, is it correct ?

Thanks !
Paul Lee
18 REPLIES 18
Bill Hassell
Honored Contributor

Re: About the Printer Model File and the non-HP printer.

Remote printers normally do not use anything except the standard remote rmodel script which is an front end for the rlp command. The model scripts for printer (other than rmodel) in the /usr/lib/lp/model are designed for serial and parallel cables to printers and can also be used for HP JetDirect LAN cards. Substituting the hp5000c30 model for the standard rlp model is not supported -- I am surprised you got anything to print at all. However, since plain text printed out, it is somehow working.

Now a bit about PCL: PCL is nothing but plain ASCII with some defined character sequences (typically called escape sequences or PCL codes). PCL5 was the last of backward compatibility -- PC5c and PCL5e began the demise of compatible printing. So if your printer is standard PC compatible, codes like ESC E (printer reset) and ESC &l1O (landscape mode) will work just fine.

http://h20000.www2.hp.com/bc/docs/support/SupportManual/bpl13205/bpl13205.pdf

The model script you mentioned performs no translation, as is true for all printer scripts in HP-UX. The script will prepend and postpend specific escape sequences in response to lp options that are part of the script. So your symbol embedded in the print job will not be and the printer will print it according to PCL rules.

So what do you mean by "PCL sumbol". All PCL sequences start with ESC (the scape character) and follow the rules shown in the above manual. If this is not how the PCL symbol is included in the print job, you'll need to explain a bit more.


Bill Hassell, sysadmin
paul.lee
Occasional Advisor

Re: About the Printer Model File and the non-HP printer.

Hi Bill,
Thanks for your kind reply.
The "PCL symbol" I mean is the "PCL codes/escape sequences" you mentioned.

I did associate the "rmodel" with the Ricoh MP C2500 before, but it didn't prepend/postpend any PCL codes/escape sequences into the print job I sent. That's the reason I try to associate the "hp5000c30" with the Ricoh MP C2500.

I want the model scipt prepend/postpend the PCL codes into the print job as the following example:
---------------------------------------------
ESC%-12345X@PJL USTATUS PAGE = OFF
@PJL USTATUS PAGE=ON
@PJL SET COPIES = 1
@PJL ENTER LANGUAGE=PCL
ESC&a5CTEXTFILE
ESC&a5CThis is a testfile
ESCEESC%-12345X
ESCEESC%-12345X@PJL
---------------------------------------------

But so far, the lp command only sends the print file itself without any PCL codes to the printer.
-----------------------------------
TEXTFILE
This is a testfile
-----------------------------------

What should I do to let the model scipt prepend/postpend the PCL codes into the print job ?

Thanks !
Paul Lee




Bill Hassell
Honored Contributor

Re: About the Printer Model File and the non-HP printer.

> > I want the model scipt prepend/postpend the PCL codes into the print job as the following example:

Actually, there are two languages, PCL and PJL (Printer Job Language). PJL is unique to newer HP printers and may not be supported on many older printers or non-HP printers. PCL support does not imply PJL support.

> But so far, the lp command only sends the print file itself without any PCL codes to the printer.

Well, first, I assume these codes:

> ESC&a5CTEXTFILE

are document representations of the actual code. Since the escape character cannot be displayed, it is often represented as ESC rather than \033 or 0x1b (the shell method to create the escape character). So to print a line of text starting in column 25:

$ echo "\033&a25TEXTFILE" | lp -dmyprinter

So in your ASCII file, you must insert those characters. In vi, you use the CTRL-v technique to insert a special character into a file. If your example is going to have the codes prepended, just create the first file, then print with cat:

$ cat special_codes myfile | lp -dmyprinter

Not convenient, but it works.

However, probably what you really want is the -o options listed in man net_ljx000. To get these options to work, the Ricoh printer will need to support port 9100 printing (rather than port 515) which is HP JetDirect compatibility mode. The Ricoh docs are not clear as to whether their LAN interface is JetDirect compatible, so just telnet to the printer's IPaddress using 9100 as the port:

$ telnet 12.34.56.78 9100

If you get a reply, then you are in luck and this model supports the JetDirect protocol. Delete the printer and add it back as a network printer. Use the hppi command:

# /opt/hpnpl/bin/addqueue -q myprinter -h 12.34.56.78 -b off -t off -r off -i 266

which creates your printer using the net_ljx000 printer script. Note that not all options will work since the printer may not have that feature.


Bill Hassell, sysadmin
paul.lee
Occasional Advisor

Re: About the Printer Model File and the non-HP printer.

Hi Bill,
Thank again!
You are right about the document representations.
---------------------------------------------
ESC%-12345X@PJL USTATUS PAGE = OFF
@PJL USTATUS PAGE=ON
@PJL SET COPIES = 1
@PJL ENTER LANGUAGE=PCL
ESC&a5CTEXTFILE
ESC&a5CThis is a testfile
ESCEESC%-12345X
ESCEESC%-12345X@PJL
---------------------------------------------

Except for the speciall codes:
ESC&a5CTEXTFILE
ESC&a5CThis is a testfile

The model scipt "rmodel" didn't insert "ESC%-12345X@PJL" in the start/end of the print file, is it normal ?

And about net_ljx000, I see an option:
------------------------
postscript/post, pcl
Print in PostScript or PCL mode.
------------------------
Does it mean the lp command will insert the PCL code into the print file with the net_ljx000 script?
#lp -dmyprinter -opcl -myfile

I'll try to add the MP C2500 as a network printer.

Thanks !
Paul Lee
V. Nyga
Honored Contributor

Re: About the Printer Model File and the non-HP printer.

Hi,

why should the printer print the PCL codes?
It's not the text you want to print.
I've configured Ricoh printer as network printer without problems.

V.
*** Say 'Thanks' with Kudos ***
paul.lee
Occasional Advisor

Re: About the Printer Model File and the non-HP printer.

Hi Nyga,
I don't want the printer to printout the PCL codes.
But I want the printer to follow the PCL codes.
I hope the print job could be inserted the PCL codes while printing.
Could you show me how did you configure Ricoh printer as a network printer ?

Thanks !
Paul Lee
Bill Hassell
Honored Contributor

Re: About the Printer Model File and the non-HP printer.

> I don't want the printer to printout the PCL codes. But I want the printer to follow the PCL codes.

If you send the correct codes, they will not be printed.

> I hope the print job could be inserted the PCL codes while printing.

You can insert the codes into the print file, or concatenate them in front of the print file as I noted above. Did you try any of the commands I listed above?

Could you show me how did you configure Ricoh printer as a network printer ?

Did you try using the command addqueue as I listed above?

I'm sorry I did not explain PCL codes very well. Putting the text:

echo "ESC&a5CTEXTFILE" | lp -dmyprinter

will print exactly what you see in this echo statement. The string "ESC" means nothing to the model script or to the printer -- it prints exactly what you see.

As I mentioned, the string "ESC" is a convention to represent the single character 033 (in octal) or 0x1b (in hexadecimal). You must insert the ready-to-print codes in front of the textfile you want to print. I mentioned how to use vi with the CTRL-V feature but if that is not something you know about, you can try the echo command I listed above:

echo "\033&a25TEXTFILE" | lp -dmyprinter

The shell code \033 is converted to the escape character.

However, you probably don't want all this detail, so add the printer with a different queue name using the addqueue command as I listed above. Then print the fie in landscape mode like this:

lp -dmyprinter -o landscape testfile

or print in compressed font with:

lp -dmyprinter -o c testfile.

Please tell us what you hyave tried and if you get an error message, please show it (like addqueue not found) which will help greatly in assisting you.


Bill Hassell, sysadmin
paul.lee
Occasional Advisor

Re: About the Printer Model File and the non-HP printer.

Hi Bill,
Appreciate for your continuous replies.
I know the what is the output of
---------------------------
echo "\033&a25TEXTFILE" | lp -dmyprinter
---------------------------
and also the PCL codes won't be printed.

And pardon me for unfamiliar with HP UX printing system.
The lp command in HP UX semms to send the print job (plaintext) directly to the remote printer without anything changed/inserted, right ?

I am looking for a way that automatically interpret the print job in the PCL code/format.

I will try the "addqueue" you mentioned and will focus on:
lp -dmyprinter -o pcl

Thanks !
Paul Lee
V. Nyga
Honored Contributor

Re: About the Printer Model File and the non-HP printer.

Hi again,

I've configured a Ricoh MP C2800 with SAM as a network-based printer
- 'add to local spooler' (ignore all messages)
with the printer type
- 'dumbplot model script for printer with CR' (is no. 55 in my list)
with printer connection
- 'other' (no. 4 in my list)

HTH
Volkmar
*** Say 'Thanks' with Kudos ***