Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Please tell me how can we print on Dot Matrix Printer using this code "Printer.Print", as i used it but i am not getting proper printout on Dot Matrix Printer while on Ink Jet Printer printout is proper. On Dot Matrix Printer it prints 10-12 characters of each line, it does not print complete line. So please if any you can solve it, please let me know.
Thanks & Regards

I have had a similar problem in my last job. I had reports to send to printers of many different types and some that had hard-coded or physical font types on them (daisy wheel anyone?) i eventually used borland C++ builder because I knew there was a printer object. later when I was forced to make it in VB (since that was what the company was willing to offer support on) I discovered that it has a printer object too.
the printer object allows you to find out the height and width of characters that will be printed as well as finding and setting the height, width, clientheight, and clientwidth of the printed page. In addition, you can print to the canvas of the printer object (hDC) just like you would to the screen, a form, or any other window.
what you will have to do is determine the width of the printed page based on the width of the font and reformat your output for each of the printers.
This might sound like a lot of work, but if you split up the code into units (DLLs) with a single EXE or DLL controlling them all you can easily add/modify a printer component without needing to recompile the entire app. Better yet, use COM+.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |