- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- PJL script - "binary" out to printer
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
Discussions
Discussions
Discussions
Forums
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
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
тАО11-10-2004 04:26 AM
тАО11-10-2004 04:26 AM
copy filename /b PRN:
is there something similar I can use? According to the PJL manual I have to send the following to my printer:
Thanks in advance.
Solved! Go to Solution.
- Tags:
- PJL
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-10-2004 04:34 AM
тАО11-10-2004 04:34 AM
Re: PJL script - "binary" out to printer
echo "\033%-12345X@PJL\r"
The linefeed is emitted be default unless the echo command ends with "\c"
Look in /var/spool/lp/interface (or the model.orig directory below it) and you should find a number of examples.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-10-2004 05:52 AM
тАО11-10-2004 05:52 AM
Re: PJL script - "binary" out to printer
And perhaps this a forest/trees episode, but, I don't understand how to send the commands to the printer...
this is now in a script...
----------------------------------------
echo "\033%-12345X@PJL \r"
echo "@PJL ECHO 11:30:00 11-10-04 \r"
echo "@PJL INFO CONFIG \r"
echo "\033%-12345X \r"
----------------------------------------
I should recieve messages back from the printer when it gets these commands.
Thanks again...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-10-2004 06:08 AM
тАО11-10-2004 06:08 AM
Re: PJL script - "binary" out to printer
Once you have the command syntax for the printer squared away, you either need to pipe the commands to the HP-UX print queue, or to a file and then send the file to the print queue:
lp -d[printqueue name] [filename]
mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-10-2004 06:11 AM
тАО11-10-2004 06:11 AM
Re: PJL script - "binary" out to printer
I'll give you another source of example files. Look specificall at /usr/lib/model/lp/paintjetXL300. It contains exactly your string.
This is a typical way to send commands to a printer:
F1="myfile"
TDIR=${TMPDIR:-/var/tmp)
T1=${TDIR}/P${$}_1.txt
echo "\033%-12345X@PJL EOJ\r" > ${T1}
echo "\033%-12345X@PJL enter language=pcl" >> ${T1}
cat ${T1} ${F1} | lp -o binary -dmyprinter
rm -f ${T1}
You might also need to send some commands at the end of the job so using the same mechanism, create a T2 file and echo commands to it then cat all 3 files together and send them to lp.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-10-2004 08:01 AM
тАО11-10-2004 08:01 AM
Re: PJL script - "binary" out to printer
-o binary option. I will assign points and revamp my question (in other words, try a different route)
Thanks;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-11-2004 12:54 AM
тАО11-11-2004 12:54 AM
Re: PJL script - "binary" out to printer
I made a remote printer using SAM.
Let's call the printer: myprinter.
I edit file /etc/lp/interfaces/myprinter.
I go to the bottom of the file.
And I see this.....
/usr/sbin/rlp -I$requestid $BSDC $BSDJ $BSDT $BSDi $BSD1 $BSD2 $BSD3 $BSD4 $BSDw
$BSDformat $BSDh $1
This line sends out the data.
Where's the filename that goes out?
It's been a while. I don't know.
But I DO know there were a pile of shift commands, and the remainder of $@ holds the names of the files. So each element in $@ is a filename.
Just ABOVE that rlp line I put....
for f in $@
do
echo '^[&l2A^M' > $f.tmp
echo '!R!^M' >> $f.tmp
echo 'MZP0,0;^M' >> $f.tmp
echo 'CALL R010;^M' >> $f.tmp
echo 'EXIT;^M' >> $f.tmp
/usr/bin/cat $f >> $f.tmp
# for very TEMP debugging....
FILE=`basename $f.tmp`
cp $f.tmp /tmp/$FILE
# end of debugging
mv -f $f.tmp $f
done
See it adds binary data to the front of each file just before it goes out.
steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-11-2004 12:56 AM
тАО11-11-2004 12:56 AM
Re: PJL script - "binary" out to printer
To add the escape key to a spot in a file.
vi filex
go to the spot you want the escape key.
press i for insert.
press control-v
press the escape key.
That's it. Save your file.
The control-v tells vi to treat the next key pressed literally.
steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-11-2004 07:32 AM
тАО11-11-2004 07:32 AM
SolutionNow virtually all of the PJL codes you need for HP printers are contained in the printer scripts. If this printer is conected to the LAN with an HP JetDirect card, then look at the man page for hpnpadmin to gather a lot of printer information. Then look at the example scripts in /opt/hpnpl/sh, perhaps the highest level script which is net_ljx00. Couple that with the man page for net_ljx00 and you'll see how PJL codes are sent to the printer. But none of the codes that generate responses are sent to the printer.
NOTE: If you have a JetDirect LAN card in your printer but do not have /opt/hpnpl directory, get the latest JetDirect software from:
http://h20180.www2.hp.com/apps/Lookup?h_query=jet+direct+printer+installer&h_tool=software&h_lang=en
You will probably find that everything you need to do with PJL codes is already contained in the model script net_ljx00 option list. Note also that you do NOT have to go through some PC server to print on a JetDirect LAN card--that's what the HPPI software does for you.
Bill Hassell, sysadmin