Is there a way for me to print to the printer with C Programming in DOS ?
Is there a way for me to print to the printer with C Programming in DOS ?
I'm not exactly a C wizard, and I can't program using ports. I'd write all the data to a file and use:-
orCode:system("copy file.ext prn");
Basically this is getting DOS to do the work for you. And if you aren't using pure DOS (Running COMMAND.COM under Windoze) I'm not sure Windoze will like it.Code:system("type file.ext >prn");
Kree'ta Tau'ri! Chaapa'ai!
i don't know if those particular commands are valid, but printing to the printer using dos stuffs under windoze 98 works for me.Originally posted by Unimatrix139
I'm not exactly a C wizard, and I can't program using ports. I'd write all the data to a file and use:-
orCode:system("copy file.ext prn");
Basically this is getting DOS to do the work for you. And if you aren't using pure DOS (Running COMMAND.COM under Windoze) I'm not sure Windoze will like it.Code:system("type file.ext >prn");
hello, internet!
I once heard that you need to write to drivers, otherwise, im not the best person to ask.
.
There are a bunch of ways in DOS, here are two
BebopCode:#include <stdio.h> main() { fprintf( stdprn, "Something to print\n" ); } #include <stdio.h> main() { FILE *stream; stream = fopen( "PRN", "w" ); fprintf( stream, "Something to print\n" ); }
Processing error: Stupidity detected.
------------------------------
Dr. Bebop
Windows XP Professional Ed.
Microsoft Visual Studio 6
>> Deosn't work with USB printers though
change "PRN" to "LPT1".
LPT1 and PRN are pretty much identical - LPT1 is the id for Parallell port 1 and PRN is the default parallell port (almost always LPT1) - Anyway, I don't think you can address LPT1 from C with fprintf, etc.
Kree'ta Tau'ri! Chaapa'ai!