- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: New to HPUX, need Help setting Printing Option...
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
Forums
Discussions
Discussions
Discussions
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
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
05-16-2005 02:58 AM
05-16-2005 02:58 AM
New to HPUX, need Help setting Printing Options using lp Command
This is the only method the customer will allow me to use to extract the data from their system, so don't ask "why are you doing it that way".
lp -dprintername -olandscape (what else ???)
Thanks for any help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2005 03:20 AM
05-16-2005 03:20 AM
Re: New to HPUX, need Help setting Printing Options using lp Command
Sounds as if you will need to make a driver to do this task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2005 03:22 AM
05-16-2005 03:22 AM
Re: New to HPUX, need Help setting Printing Options using lp Command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2005 03:30 AM
05-16-2005 03:30 AM
Re: New to HPUX, need Help setting Printing Options using lp Command
Can use a pre-existing driver file as an example to get started.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2005 06:40 AM
05-16-2005 06:40 AM
Re: New to HPUX, need Help setting Printing Options using lp Command
In PC-land, all applications make system calls in a meta-language for printer control. The Windows driver then converts this meta-language to match the capability of the printer. Nothing like this exists in HP-UX. The options like landscape and duplex are specific to certain HP printers and have no meaning to non-HP printers.
Now if you have a bunch of plain ASCII text that you wan to format to 1000 characters per line, just use the fold command as in:
fold -s -w 10000 my_file > resulting_file
As far as a page length, there is no such thing. If your target system needs some sort of code every 30000 lines to do a page eject, then a simple script can add this code.
However, I think that reading a page that is 1000 characters wide and 30,000 lines long will be extremely difficult, so perhaps the requirements have not been accurately stated. HP-UX, like any othe rflavor of Unix has no concept of line width or page length. If you can describe the source and destination data, perhaps a simpler solution can be suggested.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2005 07:16 AM
05-16-2005 07:16 AM
Re: New to HPUX, need Help setting Printing Options using lp Command
cat - |lp -dprintername -olandscape -olpi8 -ohsi9 -oc -onb -otl63
I believe I recognize most of the commands but I can find no documentation about these options. Can you help still?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2005 07:31 AM
05-16-2005 07:31 AM
Re: New to HPUX, need Help setting Printing Options using lp Command
-oc = compressed
-olandscape = landscape output
-onb = no banner page
-otl = text length
I forgot hsi, I think it is dealing with height of the type
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2005 07:36 AM
05-16-2005 07:36 AM
Re: New to HPUX, need Help setting Printing Options using lp Command
-otl text length? is this lines per page or what measurement is it using.
What is the setting for characters per line? I don't think it is cpl although it might be.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2005 07:40 AM
05-16-2005 07:40 AM
Re: New to HPUX, need Help setting Printing Options using lp Command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2005 07:42 AM
05-16-2005 07:42 AM
Re: New to HPUX, need Help setting Printing Options using lp Command
values of 0-9 in increments of #/120th inch.
tl is the text length of page
values of 0-9
If you are experimenting with the other options this text length could come in handy.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2005 07:44 AM
05-16-2005 07:44 AM
Re: New to HPUX, need Help setting Printing Options using lp Command
Not all options are going to work with all apps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2005 02:15 PM
05-16-2005 02:15 PM
Re: New to HPUX, need Help setting Printing Options using lp Command
So -ohsi -olandscape -oduplex -ocompress and so on apply ONLY to HP printers. And I don't know of any HP printer that can print 1000 characters across the page (and 30,000 lines down the page) that would anything more than tiny dots. The highest resolution LaserJets can adequately print 4 to 6 point fonts (about the size of pin head) but anything more than 400-500 characters across the page are unreadable, even with a magnifying glass.
Does the 'different system' actually have a printer with these specs or is it some program that needs the special file?
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2005 01:44 AM
05-17-2005 01:44 AM
Re: New to HPUX, need Help setting Printing Options using lp Command
Thanks for your response. But you have missed the point. Nothing is ever going to print. We are using a report writer to create a data extract. The reporting tool uses the matrix from the printer driver to format the output. We are trying to fool the report writer program so that it does not wrap the text.
I know that there are at least 100 better ways of doing this, but like I said earlier I am at the mercy of the Unix Administrator, who wants me to do his work for him. So if you have any information about option selections please let me know. It really doesn't matter if they work or not, just as long as the report writer uses them.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2005 04:14 AM
05-17-2005 04:14 AM
Re: New to HPUX, need Help setting Printing Options using lp Command
"cat - |lp -dprintername -olandscape -olpi8 -ohsi9 -oc -onb -otl63"
and then tack on your statement:
"The reporting tool uses the matrix from the printer driver to format the output.",
you are then faced with a logical impossibability. The -o options are only visible to the lp command (and possibly its child processes). There is no way that the lp option settings are going to be exported to your report writer -- and any competent sysadmin would know this. Whatever formatting options needed would need to be sent to the report writer and presumably it could then select options for lp. Moreover, if you are going to use lp to output to a file then someone must create a custom interface file -- and again, the sysadmin should know this. If this were me, I would output directly to a file and then process the data as needed afterwards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2005 04:38 AM
05-17-2005 04:38 AM
Re: New to HPUX, need Help setting Printing Options using lp Command
So the requirement to make the lines all 1000 characters in length is still ambiguous. Do you mean that each line from the input file should be padded with space to make it 1000 characters?
text...
Or do you mean that each line from the input be attached to the end of the previous line until you reach 1000 characters?
line1 line2 line3 line...line517 line518
And at the target program, does it understand the enf-of-line character from Unix (the LF or linefeed) or is it expecting a DOS/Windows style with 2 characters (CR+LF)? The specs are still too ambiguous to develop a working solution. One thing is for sure--you don't need to use the lp command for this task.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-17-2005 08:25 AM
05-17-2005 08:25 AM
Re: New to HPUX, need Help setting Printing Options using lp Command
The line length of 1000 characters is a maximum if less are used then the end of line is specified. The data generated from the report is held in a spool file. Another 3rd party application takes the spool file and strips all of the formating characters that were inserted by the printer driver and adds the DOS/Win CR/LF to the end of each line.
So, this whole process is just to trick the Report writer, which is a third party application that formats the output (inserting esc sequences and other formating information) based on a specified printer driver. This driver is specified within the report writer as one of its parameters.
I believe the Unix Admin is using the lp command as an example of the options that can be set for the driver.
I guess I could use the following:
lp -dmyprinter -olandscape -ocpi100 -otl30000 -onb
I understand that this is an inprobable printer capability, but if the report writer uses the values to perform it's formatting then it should work.
Do you think it makes sense?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2005 01:53 AM
05-18-2005 01:53 AM
Re: New to HPUX, need Help setting Printing Options using lp Command
ESC &l1O
(that's the escape character or hex 0x1b, followed by &, lowercase l, number 1 and UPPERCASE O) Now this has no meaning to a Postscript printer or an Epson or Lexmark or ... unless they have an HP PCL emulation module installed.
But you said that the target machine strips all formatting, why provide any printer formatting at all? I think all you need is to convert the ASCII file from Unix format (text-LF-text-LF...) to DOS/Windows format (text-CRLF-text-CRLF... and for this task, HP-UX already has the filter you need: ux2dos as in:
ux2dos file-to-convert > converted-file
Now if the target machine needs a code for the column width and page length, you'll need to find out what printers the target machine understands. I doubt very much that it knows anything about a LaserJet 9085mfp or DeskJet 9600 (or any other new HP printers). So rather than guess which options and codes might work, find out what the target program understands and just insert the need code in front of your text file (which is exactly what the lp printer scripts accomplish). Something like this:
ux2dos file-to-convert | cat my-codes - > final-file
Is this example, ux2dos converts your file, then cat first lists the contents of the my-codes file (where you put your formatting codes) and then appends the converted file. The result is then sent to the final-file. Again, the my-codes file just contains the special codes your target machine needs.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2005 02:57 AM
05-18-2005 02:57 AM
Re: New to HPUX, need Help setting Printing Options using lp Command
Thank you for your responses, but you just do not get the point. Of course it is meaningless, except to the report writer.
Anyway, without a clear method here, I choose a different option. I created multiple reports that fit within the 132 characters(no line wrap). Create 4 text files, and then stiched them together on my side where I have control of the data.
Thanks for all the help.