PDA

View Full Version : Printing



Unregistered
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.

damyan
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" );

etc.

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

oskilian
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


Oskilian

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