By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,660 Members | 1,939 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,660 IT Pros & Developers. It's quick & easy.

Sending console output to printer

P: 1
hello all,
how to send the program output to printer installed in any OS.



Vijayakumar
May 5 '07 #1
Share this Question
Share on Google+
2 Replies


Savage
Expert 100+
P: 1,764
hello all,
how to send the program output to printer installed in any OS.



Vijayakumar

There are couple of functions defined in bios.h.biosprint for Turbo C/C++ or _bios_printer for MS C/C++ and there is also this .

Savage
May 5 '07 #2

AdrianH
Expert 100+
P: 1,251
how to send the program output to printer installed in any OS.
There is no one single way to output to a printer across all OSs.
  • DOS/Windows: output to file PRN (will not work for network printer unless mapped)
  • Windows: use the appropriate API
  • pre Mac X: use the appropriate API
  • Mac X/Unix/Linux: Spawn a lpr process and pipe in the data to it. (lpr is the most common one of the interfaces I am aware of, but IIRC there may be others. Also, I'm assuming that Mac X does this as it is a Unix system. I may be wrong though)

Things are usually backwards compatible. See the OS's printing API or development package for more information. Also, I tried to state the print methods as generically as possible. There may however be other methods that I have not encompassed.

Enjoy.


Adrian
May 5 '07 #3

Post your reply

Sign in to post your reply or Sign up for a free account.