Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

send command to printer with asp.net

Status
Not open for further replies.

emblewembl

Programmer
May 16, 2002
171
GB
I am having to print to a dot matrix printer at a clients site. I can send my text no problem, but I need to be able to send a hex or decimal number (NOT as a string) as a printer command in order to set up paper size amongst other things. At present I have a sub which lays out my text using the following type of code:

ev.Graphics.Drawstring("string goes here",f, Brushes.Black, 475, 40)

I can send ascii characters by using this :

ev.Graphics.Drawstring(Chr(78) + Chr(84) + Chr(45),f, Brushes.Black, 475, 40)

... and so on.

One of the commands I need to send involves sending 2 characters and then a digit which represents the total number of lines to print. My question is how can I send a number??? I know I can send an ascii representation of a digit, but it is then a string not a digit. Also, the only way I have found of printing this way is by using:

ev.Graphics.Drawstring ......

... which must mean everything sent this way ends up as a string. How can I send an integer?? Any suggestions would be very much appreciated!
i love chocolate
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top