Telling a printer to print from with in my program??
Posted on 2004-04-21
I am writing a C++ program on Kylix 3 IDE. I need to build a string and send it to my printer for every transaction that occurs. I have no problem building the string and I can save it to a file. If you guys could tell me how I tell LINUX to print my file (within my program mind you) and I need just normal "$lp -receipt reports.txt" command such as this. This will print my saved reports file but i have to be outside my program in a terminal window. Thanks for your help and here is a slimed down version of my code.
ofstream fp_out("reports.txt", ios::out);
mHeader.assign("My Console program");
mHeader.append("some more stuff");
fp_out << mHeader << endl;
//here iswhere i need the command to send this reports.txt file to the printer
Thanks in advance for your help