View Full Version : Printing

10-10-2001, 03:45 PM
Hello i'm trying to write e c program that works on DOS, how can i write to printer (LPT1) with a similar command like "printf"?
Is it possible?
Thank you.

10-11-2001, 01:00 AM
may be you should try to use file streams

stream = fopen( "LPT1", "tw" );
fprintf( stream, "%s","This is a PrintTest" );


I did not try it but it should works. :-)

10-11-2001, 02:56 PM
it works, I've just tried it and it does, if you want to see a working code, download the file

but, you could also create a file which contains what you wanna print, and then call the DOS command

type myfile.txt > PRN

and then erase the file

It should work, but I have'nt tried it yet


10-16-2001, 07:28 AM
Thank you for your time it works perfectly for my needs!!