Send data(bytes/stream) to a printer
-
Hi, I am trying to print a file. The file can be word, ppt, xls etc etc. Instead using the COM objects i want to print the required file, so i thought i would open the file through binary reader and then send the bytes to the printer thereby printing the required file! Is there any other way? To print the required file The printer setting are set in a way that the file after print would be saved in a default location!
gauthee
-
Hi, I am trying to print a file. The file can be word, ppt, xls etc etc. Instead using the COM objects i want to print the required file, so i thought i would open the file through binary reader and then send the bytes to the printer thereby printing the required file! Is there any other way? To print the required file The printer setting are set in a way that the file after print would be saved in a default location!
gauthee
In order to print directly to a printer, you have to send native codes in the language of the printer. This is all done for you in the background via the windows printer drivers. So, unless you have specific knowledge of each printer your application is going to use, use the windows print drivers. If you try to send a word file directly to the printer, nothing will happen. Hogan
-
Hi, I am trying to print a file. The file can be word, ppt, xls etc etc. Instead using the COM objects i want to print the required file, so i thought i would open the file through binary reader and then send the bytes to the printer thereby printing the required file! Is there any other way? To print the required file The printer setting are set in a way that the file after print would be saved in a default location!
gauthee
gauthee wrote:
i thought i would open the file through binary reader and then send the bytes to the printer thereby printing the required file!
And in each and every case, you'll be printing pages and pages of complete garbage. You can NOT just send what the application saved to disk to the printer and expect a nice image to appear on the paper. The printer doesn't know anything about any applications file format and applications don't save their files as a nice printed image on disk.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007