Solved

Print to file in Unix

Posted on 1997-12-14
4
579 Views
Last Modified: 2013-12-06
In Microsoft Windows, it is possible to use the "print to file" option when printing. In this case, the binary data, including printer control codes, is written to a file instead of being sent to the printer.

I want to do this in unix (ideally Hewlett-Packard unix), in order to see what control codes are being sent to the printer.

NOTE: I want to see the printer control codes added by the unix printer driver, so simple file redirection (using the ">" character) will not work.
0
Comment
Question by:mkellerman
  • 2
4 Comments
 

Author Comment

by:mkellerman
ID: 2008330
If you know any way to see the printer control codes added by the unix printer driver, this will solve my problem.
0
 
LVL 3

Accepted Solution

by:
Jackie071497 earned 200 total points
ID: 2008331
Many printers have the feature of hexa-dump mode.
Under this mode, printer will output each byte received to hexa
value, no matter what it is data or control code.
I called it as "printer debug mode" and it is hardware-level
debuging. It works for DOS, Windows, OS2, Unix, ......
The only factor is "You can print data to printer under your OS".
Maybe you should check your printer manual how to setup hexa-dump
mode. If failed, tell us about your printer style.

0
 
LVL 1

Expert Comment

by:cemaylor
ID: 2008332
There is a second option here, which is to temporarily disable the system spooler.

The result of this on many UNIX systems is that the printer will accept the job, and create the output file, but as the spooler is not running it will maintain a file in the jobs directory.

You could then hd (hexdump) the file to see the codes, or hit it with an editor or ??

Remember to reenable the spooler when done.


0
 

Author Comment

by:mkellerman
ID: 2008333
Hello Jackie and Cemaylor:

Thank you for your suggestions. I have passed them on to the engineer in the location where the printer is and am waiting for him to report on the results of applying your 2 suggestions.

At that time, I'll grade your answers.

Thank you for yuor help.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
FreeBSD on EC2 FreeBSD (https://www.freebsd.org) is a robust Unix-like operating system that has been around for many years. FreeBSD is available on Amazon EC2 through Amazon Machine Images (AMIs) provided by FreeBSD developer and security office…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

778 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question