Chandra Eskay
Chandra Eskay

Reputation: 2203

Print on a Dot Matrix printer using X & Y Coordinates

I have a requirement to print a bill on a dot matrix printer in basic mode. I know that Dot matrix printer page can be divided into a matrix of characters and i just want some help on how print on X&Y co-ordinates. It is something like this,

Printer.CurrentX = 1584;
Printer.CurrentY = 3168;
Printer.Print "PARTICULARS";

Does anyone have a sample on how to do this or some a little idea would help me. Thanks,..

Upvotes: 0

Views: 2345

Answers (2)

Mark Hall
Mark Hall

Reputation: 54532

The Printer.CurrentX and Printer.CurrentY are from the VB6 era, they set the coordinates in Twips of where you put your text but does not print untill you use the Printer.EndDoc Method. There is a .Net version of this in the Microsoft.VisualBasic.PowerPacks.Printing.Compatibility.VB6 Namespace that was provided for converted VB6 programs. You could add the NameSpace to your program and use the same functions, but you would be better off using the PrintDocument's Print Method. Since they both are going to print in page mode anyway(by that I mean you setup your data and send the entire page to the printer when you print) .

Upvotes: 1

Guffa
Guffa

Reputation: 700152

A dot matrix printer doesn't work that way. The dot matrix is the method of printing on the paper, it's not a matrix that is used to specify output.

To print a page you normally print it from top to bottom, line after line. You don't specify coordinates for the text, you simpy output spaces and line feeds to get to the right character position.

(There are control characters that you can send to the printer to feed the paper backwards, but feeding the paper back and forwards a lot is just asking for a paper jam.)

Upvotes: 1

Related Questions