Computing.Net > Forums > Programming > DOS Printing in VB on Dot Matrix Pr

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

DOS Printing in VB on Dot Matrix Pr

Reply to Message Icon

Name: Gyanendra Jain
Date: June 18, 2003 at 00:29:30 Pacific
OS: WIN 98
CPU/Ram: 128 MB
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: Chi Happens
Date: June 21, 2003 at 06:20:00 Pacific
Reply:

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+.


0
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: DOS Printing in VB on Dot Matrix Pr

fast report printing in vb www.computing.net/answers/programming/fast-report-printing-in-vb/1527.html

text mode printing on dot matrix printer www.computing.net/answers/programming/text-mode-printing-on-dot-matrix-printer/2036.html

vb programming - DOS - printing..[cr.rpt www.computing.net/answers/programming/vb-programming-dos-printingcrrpt/914.html