[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

sending commands to a printer

Posted on 2010-01-08
9
Medium Priority
?
345 Views
Last Modified: 2012-06-27
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
Comment
Question by:frankie_jnr
  • 3
  • 3
  • 3
9 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 26216963
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
 

Author Comment

by:frankie_jnr
ID: 26278502
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
 
LVL 101

Expert Comment

by:mlmcc
ID: 26279586
It has been a while since I have done it but I believe just use the PRINT statment directed to the printer.

mlmcc
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 83

Expert Comment

by:CodeCruiser
ID: 26279870
0
 

Author Comment

by:frankie_jnr
ID: 26291242
I cant seem to get it working. I assume i should use the SendBytesToPrinter()
part
0
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 26291334
Use the SendStringToPrinter function. Make sure you use the correct commands.
0
 

Author Comment

by:frankie_jnr
ID: 26330851
hi there i am still trying to get this working what string should i send ?
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 1000 total points
ID: 26330943
I think that function would send the string to print rather than a command.
0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 1000 total points
ID: 26331770
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month19 days, 15 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question