Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Print to file in Unix

Posted on 1997-12-14
4
Medium Priority
?
606 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 400 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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.:
Suggested Courses

719 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