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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending command to printer thru vfp

Status
Not open for further replies.

skyyonk

Programmer
May 6, 2002
23
0
0
SG
Hi all,

I am using EPSON LX-300 (dot matrix printer) to print out label. Using ??? command to send everything out to the printer. I need the first line of characters which is my identification number to be bigger then the rest of the label. The rest of the wordings would be condensed draft mode will do. How can i do this?


 
skyyonk

SET DECIVE TO PRINTER
SET PRINTER ON

@1,1 SAY "Whatever"

??? chr(7)
Mike Gagnon
 
If you are using a Windows Printer driver, consider using the report writer, and this will all be handled for you. If you are using the Generic / Text Only printer driver you can normally send these kinds of control characters to the printer. There are also techniques to print raw "directly" to the printer (actually it still goes though the WinAPI). Do a Keyword Search (tab is above) to find discussions on this topic for each of these possible solutions.

Rick
 
skyyonk

This should read:

SET DEVICE TO PRINTER
SET PRINTER ON
@1,1 SAY "Whatever"
??? chr(7)
Mike Gagnon
 
Sure Rick is right but sometimes there are situations...

The Escape-Codes for the LX-300 can be found in the APPENDIX-Chapter on the following Site:


To send the escape-Character just use:
??? chr(27)+WhateverEscapeSequenzeYouWant

So I would try:
Code:
??? chr(27) + "P" + "ID:124376234"
??? chr(27) + chr(15) + "Line2"
??? "Line3"
...
hope this helps
Andreas
 
Andreas,
While that may work on a local printer using Windows drivers, I've found that often Network printers will take those characters and &quot;print&quot; them, then terminate that job, reset the printer and print the rest of the data &quot;normal&quot;! < s >

Rick
 
Hi Andreas,

I have read the Escape-Codes for the LX-300 in the APPENDIX-Chapter. I've got a question.

e.g. ESC x n
n = 1:NLQ
0:Draft

What is the actual code for sending 'n' to printer from vfp?
 
n is hexadecimal, i.e. chr(1) or chr(0)...
(see Command Summary, Examples)
Tesar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top