I am in the process of developing a Cheque Printing application in VB.Net and will be using an “OKI Microline 390 Turbo” as my dot matrix printer on Windows 7 32-Bit.
I’ve been using several escape sequences to control the pitch, font type etc. What I am stuck on now is the positioning of things. As I am printing information on a cheque, I need specific information to go in certain positions but cannot figure out how to accomplish this.
I was able to use tabs to position things, but have realized that this is not going to work, as depending on how many characters are in the text will make the position go off and push the tabs out of place.
Sample code here:
Public Const eClear As String = Chr(27) + "@" + Chr(27) + Chr(107) + "2"
Public Const eNmlText As String = Chr(27) + "!" + Chr(0)
Public Const eHTAB As String = Chr(9)
Public Sub PrintBody()
Dim N2WResult As String
N2WResult = AmountInWords(txtMAmt.Text)
Print(eClear + eHTAB + eHTAB + eHTAB + eHTAB + eHTAB + eHTAB + eHTAB + " " + eNmlText + txtMChqNum.Text + vbCrLf + vbCrLf + vbCrLf)
Print(eHTAB + " " + eNmlText + DateTimePickerM.Text + eHTAB + " " + eSmlText + N2WResult + vbCrLf + vbCrLf)
Print(eNmlText + txtMPayTo.Text)
I’ve found a list of escape sequences here: http://whitefiles.org/b1_s/1_free_guides/fg2cd/pgs/c03c_prntr_cds.htm
and have also downloaded the manual for my printer which has the Epson escape sequences as well. But I need "EXAMPLES" on how to accomplish the positioning of things. I've been all over the Net, and have been able to find the sequences but cannot find examples on how to use them.
After doing some reading I think what I am looking for is to set a "Horizontal/Vertical Absolute Position", which I think means the printer carriage will go to that specific position and start to print there. So I'm guessing I will need a few of them to ensure the data prints exactly where i want it to on the cheque.
Can someone let me know if this is the way to go? And if so to please provide some EXAMPLES of it in use?