Solved

Print to file in Unix

Posted on 1997-12-14
4
559 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
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…

762 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now