cancel
Showing results for 
Search instead for 
Did you mean: 

Tru64 to HP-UX: print formatting

 
SOLVED
Go to solution
Highlighted
Regular Advisor

Tru64 to HP-UX: print formatting

Hey all, we're migrating a fairly sizable application from Tru64 to HP-UX 11.23, and we've hit a bit of a brick wall. On Tru64, the application folks are able to print their stuff with special formatting using the "-l" option that lp provides on that OS. HP-UX doesn't have a -l option, so it's just printing out the special characters as it sees them.

I'm trying to determine if there's anything I can do to get HP-UX to actually format the data (with fonts, italics, bolds, etc.) the way they need it. There's some indication I may be able to use "filters", but 1) I don't know how to do that and 2) I don't believe any filters are in use on our Tru64 box. Apparently the vendor for the application has made this work, and other customers of theirs have as well, on HP-UX; we're trying to determine how. Is there some kind of custom interface script I need to find?

Thanks!
15 REPLIES 15
Highlighted
Respected Contributor

Re: Tru64 to HP-UX: print formatting

look at the -o option in HPUX and also do a man on the pr command
Highlighted
Honored Contributor

Re: Tru64 to HP-UX: print formatting

it appears that the Tru64 system uses "printcap", something which HP-UX doesn't know about.

The migration tool you noted in your other thread appears to handle the conversion (build the filter?) for you...now if you could only get your hands on it....
Highlighted
Honored Contributor

Re: Tru64 to HP-UX: print formatting

HP-UX uses SysV print spooler whereas printcap belongs to the BSD school of thought (so to speak...) As such, special characters in the data stream are sent to the printer. Each printer will have a printer script which typically has only one filter, the ux2dos converter that adds CR to every LF (the Unix end of line character). You can certainly create a filter and insert it into the printer scripts. There are essentially 2 major printer languages in the world, PCL (which is ASCII with extra features) and Postscript (which is an ASCII page definition language). For completeness, EBCDIC is still used (in dark corners of mainframe print rooms) but is not a formatting language.

There are indeed filters on the Tru64 box since something has to interpret the embedded codes and then output the required codes for the printer. Windows does this by using an intermediate printer metalanguage which is then interpreted by printer drivers. This allows for the same application to remain printer neutral and the OS takes care of the myriad of printers. So for HP-UX, you would take all the formatting codes, pick a target printer and perform the translation within the printer script. Simple matter of scripting (big smiley)


Bill Hassell, sysadmin
Highlighted
Regular Advisor

Re: Tru64 to HP-UX: print formatting

What I THINK I have is a situation wherein the jobs are being sent from the Tru64 box unfiltered to the Windows print server. My understanding was that the Windows print server was responsible for handling the escape codes that control font, color, etc. I can't find any active filters in Tru64, so it's gotta be happening on the Windows side, right? Why is that working in Tru64 but not HP-UX?

Thanks!
Highlighted
Honored Contributor

Re: Tru64 to HP-UX: print formatting

"My understanding was that the Windows print server was responsible for handling the escape codes that control font, color, etc. I can't find any active filters in Tru64..."

In that case, I would've thought sending a plain file to the windows box would do the same.

Have you tried configure this a "remote" printer (using SAM) as opposed to a network printer. SAM -> Printers & Plotters -> LP Spooler -> Printers & Plotters -> Actions -> Add Remote Printer.

Printer name will be the name you want to use on the UNIX box...probably want to keep it the same as the printer on the Tru64 one. The you need the name (or IP might work???) of the Windows box and the Windows Printer Name to use...

If you can capture the print output of the program, you might try ftp'ing it direct to the printer just to see if the control codes embedded in the file work...
Highlighted
Regular Advisor

Re: Tru64 to HP-UX: print formatting

Here's an example of what they're sending; a bunch of data with escape sequences looking like this:

^[&k2G ^[&dD^[(s3BPrintout Test Page^[(s0B
^[&d@
^[&dD^[(s3B^[(s0B^[&d@



^[(s3B^[(s1SUsing Plain Text Printing^[(s0S^[
(s0B
^[(s3B^[(s1S^[(s0S^[(s0B


I can't even determine what language that is. PCL? Postscript? I'm lost.
Highlighted
Honored Contributor

Re: Tru64 to HP-UX: print formatting

Missed one thing....when / if you try setting up the remote printer, make sure the "BSD" selection is "on"
Highlighted
Honored Contributor

Re: Tru64 to HP-UX: print formatting

It very well could be the exact escape sequences to trigger a specific function on the particular type of printer. That's kind of what "printcap" was for.

given a printer type and known function, it would provide the control / escape codes to do that on the given device. These get added to the file and are "processed" by the printer as they are found in the data stream. It is somewhat like "termcap/terminfo" processing for terminals...ie. tput clear will clear any terminal it knows about, tput sgr0 resets defaults, and so on. The actual characters to provide those functions are provided by the terminal definition info, while "clear" and "sgr0" are function names.

or (and I've seen this a couple of times) the application itself writes the control codes...which is really ugly, as it can tie you to a particular type/model of printer.
Highlighted
Regular Advisor

Re: Tru64 to HP-UX: print formatting

I did indeed add it as a "Remote" printer; I can't add it as a "Network" printer because I don't have any of the JetDirect software. I've tried adding the printer as BSD and not BSD, no dice either way.

I've done some editing in the file so that it seems to send out the file as Postscript data, but now I'm getting the following:

PostScript Error Handler
Offending Command = &k2G
Error = nametype : undefined
Stack =

Any idea what this means?