- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Printing from HPUX to a PC using remote
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
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
тАО05-27-2009 03:13 PM
тАО05-27-2009 03:13 PM
Should I put some escape characters on the begining of the file to achieve this, or is there a better way.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2009 03:37 PM
тАО05-27-2009 03:37 PM
Re: Printing from HPUX to a PC using remote
the problem is that you will need to print to different queues based on the desired output.
I haven't tried this is several years, so I don't recall if this works or not.
On the other hand, depending upon the printer and interface, you might simply be able to set it up as a regular network printer and bypass windows altogether.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-27-2009 05:38 PM
тАО05-27-2009 05:38 PM
SolutionThe best way to implement this is to print through a filter made out of a model script that matches your destination printer. The lp spooler runs the file through a printer script and prepends escape codes in front of the job to carry out the -o options. Depending on how transparent you want to make this, you can just call a model script directly and supply the required options, and stdout from the script is then sent to the lp command.
Windows just sends the file to the printer as is. While you can play with customizing on the Windows side, it is always the same (always landscape or always 12cpi, etc).
If the model script is too much coding, you can simply prepend the escape sequences using cat:
cat mylandscape.txt somefile | lp
The file mylandscape.txt just has the required codes (one line).
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-28-2009 09:56 AM
тАО05-28-2009 09:56 AM
Re: Printing from HPUX to a PC using remote
I couldn't get the dedicated windows queue solution to work.
I was able to build a script to pre and post append escape sequences before sending to lp.
Here is my code that is based on a model script that Bill H. had previously posted:
#!/usr/bin/sh
# Truly dumb model script
export PATH=/usr/bin
export PATH
FILES="$@"
# Print the spooled files
for LPFILE in $FILES
do
# cat "$LPFILE" 2>&1 # replaced by ux2dos command
echo "\033&k2S" # Compress print
ux2dos "$LPFILE" 2>&1
echo "\014\c"
done
This is generally working, except for after the job is finished the printer acts like data is still coming, then it goes to and alarm, then I clear the alarm and nothing else prints. I need that last sequence at the end to force a form feed or the end of my report does not print, but I suspect that it is not pefect. I have exprimented with different esc sequnces but none work any better.
My other concern with this remote printer setup is, that if the remote desktop acting like a print server is not available my lpstat seems to hang. I guess it would eventually time out but I have always cntrl-c out of it. I am running on a HPUX 11.11 and I am thinking of setting up about 20 or more of these print servers, but I am worried that if a few of these devices are not available the lpstat may hang for a significant amount of time. Is there a way to decrease the time out on these devices.
I am using remote printers because the desktops will be VPN into our private network. If I were to use traditional networked printers the remote networked printers would not be tunneled into our private network. Remote printers seemed to be an inexpensive solution, but I am concerned with what unavailabe devices will do to the overall performance, maybe there is a better way of doing this without committing to special hardware at each location?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-28-2009 04:23 PM
тАО05-28-2009 04:23 PM
Re: Printing from HPUX to a PC using remote
ux2dos /etc/issue | xd -xc
0000000 6870 6433 3730 200d 0a1a
h p d 3 7 0 \r \n 1a
000000a
(the xd -xc displays the hex and ASCII characters as well as all control characters)
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-28-2009 04:30 PM
тАО05-28-2009 04:30 PM
Re: Printing from HPUX to a PC using remote
> lpstat seems to hang
Yep. The SysV lp is archaic and desperately needs a makeover. There isn't any fix at this point because both ends need the code improvements. That's why JetDirect is better (but still not robust for printer conditions). COme to think of it, Windows has a lot of problems with printer hangs too...
Bill Hassell, sysadmin