sending ascii and hex codes to printer 
Author Message
 sending ascii and hex codes to printer

does anyone ahve any experience in sending hex codes and
ascii codes to a printer port in vb.net? i want to send
<1b><70>(48)(100)(250). the numbers in smoth brackets are
deci codes and the ones in angled brackets are hex codes.

thanks



Tue, 09 Aug 2005 01:22:12 GMT  
 sending ascii and hex codes to printer
I'm going to date myself here.  Generally speaking, escape squences start
with Chr$(27)  -- hence the word escape.

Looks to me like your doing that with hex 1b which equals chr$(27)
Now, depending upon your printer's requirements for the sequence, in your
case,
it looks like your talking to an Epson?, anyway, generally speaking, it
should look like this:

CHR$(27) & CHR$(112) & CHR$(48) & CHR$(100) & CHR$(250)

I think your next step is to include the command as part of the stream
you'll be sending to the printer.
Placing it where you desire the expected behavour.


Quote:
> does anyone ahve any experience in sending hex codes and
> ascii codes to a printer port in vb.net? i want to send
> <1b><70>(48)(100)(250). the numbers in smoth brackets are
> deci codes and the ones in angled brackets are hex codes.

> thanks



Tue, 09 Aug 2005 02:30:31 GMT  
 sending ascii and hex codes to printer

With e.Graphics
            .DrawString(Chr(27) & Chr(112)& Chr(48) & Chr(100) &
Chr(250), _
              mFont, Brushes.Black, xPos, yPos)

End With

the above code is what i have for my printDocument i am assuming when i
call the printdocument.print method it sends the codes to the printer.
However, this doesn't work. Apparently we need to sent the hex code
equivalent of 'escape' is that just as easy as sending :

With e.Graphics
            .DrawString("1b" & "70" & Chr(48) & Chr(100) & Chr(250), _
              mFont, Brushes.Black, xPos, yPos)

End With

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Tue, 09 Aug 2005 04:07:07 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Sending ASCII char codes to printer

2. command in ASP/VBscript to convert date and time into a Hex code, ASCII code

3. command in ASP/VBscript to convert date and time into a Hex code, ASCII code

4. Whats the correct Hex Code for Binary/Ascii?

5. I m trying to send ASCII string(s) to non-default printer - problem

6. Sending Printer control Codes to printer

7. Help, how send hex code?

8. sending hex control codes via serial port

9. Copy ASCII Codes to Network Printer does not Work Permison Error

10. Sending Printer Control Codes (Escape Codes)

11. HOW TO SEND CHAR ASCII CODE LAGRE THAN 128

12. Send ascii codes

 

 
Powered by phpBB® Forum Software