Solved

Print to file in Unix

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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

623 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