Click to See Complete Forum and Search --> : Printing a file to a network printer


Indy
May 13th, 1999, 10:27 AM
I am writing a program in visual C++ and at one point in it, I want to send a file to our network printer. I cannot use a system("file > lpt1") call because I am on a network. What is the code I have to write in order to print a file to a network printer from a C++ program?

Thanks

September 8th, 1999, 09:57 AM
Hi

I have a similar problem. I need to print a RTF file to a printer from VC++. Any responses/suggestions would be greatly appreciated.
Please send mail to ajp_dsm@yahoo.com.

Thanks
Paul

cconn
September 8th, 1999, 12:18 PM
I believe that you should be able to open a file to the printer via \\servername\printer (where servername is the name of the print server, and printer is the name of the printer (i.e. \\MyServer\Dumbo). Note that the double backslash is required, and therefore must be 4 backslashes, as well as two backslashes after the servername. This should work for most printers, but keep in mind that formatting isn't an option using this method. It will print in the default font of the printer.