• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 359
  • Last Modified:

sending commands to a printer

Hi all,

I have a epson lx-300+ printer. what i want to do is ask is there a way in vb that i can send a command to the printer. Currently i have to press the load/eject button on the printer before i can print to get my alignment right. I wonder if i can write a simple app to do that for me.

Thanks for the help and hope this makes sense :P

Frank
0
frankie_jnr
Asked:
frankie_jnr
  • 3
  • 3
  • 3
2 Solutions
 
mlmccCommented:
You should be able to.

In the printer manual there are ESCAPE codes for many things like formfeed.

Simply print a line like
chr(27) & vbFF

chr(27) is ESCAPE

mlmcc
0
 
frankie_jnrAuthor Commented:
how would i do that? I usally use crystal report to do my printing but i assume there is a way to send the command directly?
0
 
mlmccCommented:
It has been a while since I have done it but I believe just use the PRINT statment directed to the printer.

mlmcc
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
CodeCruiserCommented:
0
 
frankie_jnrAuthor Commented:
I cant seem to get it working. I assume i should use the SendBytesToPrinter()
part
0
 
CodeCruiserCommented:
Use the SendStringToPrinter function. Make sure you use the correct commands.
0
 
frankie_jnrAuthor Commented:
hi there i am still trying to get this working what string should i send ?
0
 
CodeCruiserCommented:
I think that function would send the string to print rather than a command.
0
 
mlmccCommented:
You need to send strings that start with the ESCAPE character (chr(27)) then a character for the appropriate function.  You need to look at your printer manual to determine what characters to send.

mlmcc
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 3
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now