Re: Controling dot-matrix printer
- From: Joseph M. Newcomer <newcomer@xxxxxxxxxxxx>
- Date: Sun, 03 Dec 2006 16:20:25 -0500
Because a DC can be drawn on randomly, there is no way to use a DC-based printing solution
that will print "immediately". I'm not sure that you can't fool it, but I suspect that
there is enough going on under the floor that ending a page implicitly forces a page
eject.
In the case of the label printer, we had to deal with issues about font sizes,
particularly if the address lines were long, and the original MS-DOS program took care of
all of this. It handled a couple different label formats, and had special features to
allow us to do printer alignment so the labels were properly printed; it overrode the
printer's page-eject mechanism so we could use continuous-feed labels, and there were many
other bells and whistles. The program worked for precisely one model of printer from one
manufacturer. The printer is unbelievably reliable, and is now 25 years old, still going
strong. So portability and device-independence were not issues we were overly concerned
with. That's what you have to give up if you want to manipulate the printer directly.
Perhaps there is a "compatible, device-independent" solution, but I'm not aware of one at
the moment. But if you're willing to give up device independence, just open the LPT
device and write to it using WriteFile, writing the raw bits.
I'm not sure Windows supports an intermediate position.
joe
On Sat, 02 Dec 2006 09:35:52 +0800, Justin <justin1021@xxxxxxxxx> wrote:
Jonathan Wood ????:Joseph M. Newcomer [MVP]
Thanks.
I had used the printing DC to print data, but it always print one page
by one page. What I want to do now is to print just one line of a page.
For dot-matrix printer, it will just output one single line, and the
page will remain on the printer for next line. If I use printing DC,
then it will print the whole page out.
In the general case, you can simply print to the Windows device context for
any printer supported by Windows and it should work. Did you try this? What
is wrong with it?
If you need to programmatically control a specific printer--I can't image
why you'd need to do this--you need to get a reference for *that* printer so
you know which codes have what affect.
email: newcomer@xxxxxxxxxxxx
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
.
- References:
- Controling dot-matrix printer
- From: Justin
- Re: Controling dot-matrix printer
- From: Jonathan Wood
- Re: Controling dot-matrix printer
- From: Justin
- Controling dot-matrix printer
- Prev by Date: Re: Solved: No border on dynamically created CListCtrl in W2K (fine on XP)
- Next by Date: Re: Enumerating controls in a dialog
- Previous by thread: Re: Controling dot-matrix printer
- Next by thread: Re: Controling dot-matrix printer
- Index(es):
Relevant Pages
|