- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Using a PCL file with the "lp" command in UNIX
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
тАО02-11-2002 09:00 PM
тАО02-11-2002 09:00 PM
We are currently using a HP LaserJet 8000 printer and printing from UNIX. In the past (sorry, not sure what type of printer we used before), we had created separate PCL files (with a .pcl extension) and fed those to the lp command to get the output formatted the way we wanted. For example:
lp -d
where sample.pcl contains the relevant PCL codes to get the output correctly formatted. Now it treats these as as two files, trying to print the .pcl file rather than using it to give format commands to the printer.
Is there a different command we should be using? Or are their settings we need to configure on the printer?
Thanks for any help!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2002 09:20 PM
тАО02-11-2002 09:20 PM
SolutionHow is the printer connected to the system. Is it through the network or on the local parallel port. If it is on the local parallel port, you can cat the file on the parallel port and see is it works,
cat sample.pcl file_name > /dev/lp0
Make sure lp0 is the device file for the parallel port on which the printer is connected locally.
I can't say how you could be printing the two files together in one single command without the printer trying to print it as two seperate files. The only option could have been without a formfeed between the two prints. In such a case the first file contain some printer setting commands and the 2nd file is the actual printout. You can try it by turning the page feed after printout off.
Hope this helps.
Regds
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2002 11:33 PM
тАО02-11-2002 11:33 PM
Re: Using a PCL file with the "lp" command in UNIX
Assuming you are using Jetdirect there is a man page.
net_ljx000(1) net_ljx000(1)
NAME
net_ljx000 - HP JetAdmin model script
SYNOPSIS
lp [ -o option [ -o option ] ...]
DESCRIPTION
The model script net_ljx000 is one of the net_lj* model scripts included in HP JetAdmin distribution. While most options are common among the net_lj* model scripts, net_ljx000 contains expanded options specifically for the HP LaserJet 4000, HP LaserJet 5000, HP LaserJet 8000, HP LaserJet 8100 and HP Mopier 320. For example, more values
for the dpi option, more media size options, and a fuser temperature option.
The model script net_ljx000 will not print the following files: shar file, executable, archive, library, object, and compressed. Instead, it prints out a single page, indicating the reason.
OPTIONS
options List all available options for net_ljx000.
auto Auto-switch language (PostScript or PCL) based on file
type. Default.
postscript/post, pcl
Print in PostScript or PCL mode.
hpgl2, hpgl2_p Print in HP-GL/2 landscape or portrait mode.
relay Pass data to the printer without adding any commands.
r/raw Print in raw mode. No CR, LF, or FF processing will be
performed.
dpi<#> Set the resolution to the specified dpi, where <#> is
either 3/300, 6/600, 12/1200/12pro, or 12fast/1200fast.
If <#> is not specified, the printer's front panel sets
the default dpi. The 12pro sets true 1200 dpi with
slow speed at 8ppm. All other dpi settings print
faster at 16ppm speed for LaserJet 4000 and LaserJet
5000, 24ppm speed for LaserJet 8000, 32ppm speed for
LaserJet 8100 and Mopier 320. The 12/1200/12pro is not
Ensure that you are using the correct script.
Give the -opcl
Then try
1)As 2 seperate files
2)Cat files|lp -dprinter -opcl
The second should work
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-11-2002 11:40 PM
тАО02-11-2002 11:40 PM
Re: Using a PCL file with the "lp" command in UNIX
Depending on what your sample.pcl file does it could be you could achieve the same with lp-options. If not something along Sanjay suggestion may be the answer. If you don't have a hard-wired printer you may try: cat sample.pcl file_name > newfile, lp -dprinter newfile.
Regards,
Trond
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-12-2002 05:44 AM
тАО02-12-2002 05:44 AM
Re: Using a PCL file with the "lp" command in UNIX
"#hpnpf -x
see man page of hpnpf for more options.
-Vijay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-12-2002 07:18 AM
тАО02-12-2002 07:18 AM
Re: Using a PCL file with the "lp" command in UNIX
use lpr instead of lp
lpr -dprinter -opcl (parameters) pclfile file
It is /usr/bin/lpr and a simple script if you wish to play with it.
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-15-2002 02:15 PM
тАО02-15-2002 02:15 PM
Re: Using a PCL file with the "lp" command in UNIX
The solution that actually worked best for my situation was:
cat
(By the way, my printer was networked, not local).
This got it to the point where it was starting to show it could change orientation and such, but the indentation was still coming out wrong. Turned out I had to remove the reset command (EcE) that was at the beginning of the PCL file for it to print properly.
Commands I tried that did not work:
lp -d
lpr -d
A great reference document I used that aided my understanding of each PCL command that came from this web site was "HP LaserJet Printers - PCL Commands, Basic Page Formatting, and Font Selection". I just wish that document would have made some attempt at explaining how to actually implement the PCL commands, expecially in the UNIX environment. Would have saved us all a lot of time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-15-2002 07:55 PM
тАО02-15-2002 07:55 PM
Re: Using a PCL file with the "lp" command in UNIX
- The printer must be reset after EVERY job. Otherwise, subsequent jobs will inherit settings, fonts, macros, etc from previous jobs. A job is defined as a file that is given to lp to print. lp file1 file2 is actually 2 separate jobs.
- lpr does not exist as HP-UX is SysV not BSD and the lpr command is from the BSD flavors of Unix. lpr on HP-UX is a simple lp-wrapper script.
Note that pure PCL files that were created on another platform (ie, a PC) will not print correctly due to CR/LF issues. Unix never provides CR after the LF in an ASCII file so the printer script always provides this. However, a PC driver adds the appropriate CR to LF characters and if printed without -oraw option, the PCL file will have extra CR's added throughout the file whether needed or not.
In your case, the PCL file is actually a simple preface to the ASCII file and will work fine in the mode you have chosen. Just be aware of the issues with CR/LF when dealing with HP-UX.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-15-2002 08:54 PM
тАО02-15-2002 08:54 PM
Re: Using a PCL file with the "lp" command in UNIX
The reset "EcE" was the first command in what I'm calling my "PCL File". Then it would have commands following in the same line to do other manipulations like change font size, print landscape, etc.
I already know I can't have EcE as the first command, because then it WOULD interpret landscape and some of the commands correctly, but it WOULD NOT do the indentation correct.
I don't think I can put the reset command as the last command of my PCL file, because I would think it would reset all the commands I just set before it printed the file I wanted to affect. So, any other suggestions how to reset after every file as you made mention was needed in my case?
My "PCL file" gets reused generically by many reports. So it's not as simple as being able to add the reset command to the end of the file I'm trying to print. Unless maybe I create a "reset PCL" file and cat that as the third file in the string? Like:
cat
At any rate, it seems like the printer is resetting itself on it's own, as subsequent print outs do not seem to be affected by my PCL file changes. In theory, is that possible? It is in reality.
I understand how the original command (lp -d
Anyway, I appreciate the insight and any other tips you have to offer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-16-2002 07:16 AM
тАО02-16-2002 07:16 AM
Re: Using a PCL file with the "lp" command in UNIX
Also make sure that someone has not changed the default fonts and spacing, etc on the printer. All of these can be overridden in your PCL control file but you must enumerate *every* setting...or you can cold reset the printer (turn it off, hold the online key down and then turn it on again while holding the online key down. The front panel will show COLD RESET when done successfully. NOTE: if you manually set the network interface from the front panel, you'll have to reenter the settings again.
As far as the indents go, there are a dozen different ways to perform indenting using PCL codes but many depend on current printer settings. If the indents aren't stable, use a different technique that is not affected by previous settings.
To see exactly what was sent to the printer on a particular job, use the disable commnand to turn off the printer output. Then print the job and cd to the print spool directory (/var/spool/lp/request/
Bill Hassell, sysadmin