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!

Printing in continuous form 1

Status
Not open for further replies.

SitesMasstec

Programmer
Sep 26, 2010
526
Brasil
I want to print labels in my Epson dot matrix printer, using a program written in VFP 9 (just .PRG, not Label Form), but as I print some labels the printer skips some lines as if it is using Letter or A4 forms (not continuous form I am actually using). How to avoid this skipping of lines ?
Thanks,
Tony

 
The easiest way I've seen so far is to first, define a 'Generic/Text only' printer as your printer driver on LPT1.
You can then use ??? (yes, three ?'s) to print a line to the printer.
The three question marks basically tells VFP to print directly to the printer port.
After the print job is finished, issue two SET PRINTER TO commands to empty the buffer. As an example:
Code:
STORE CHR(13) + CHR(10) TO cNewLine

???cFullname + cNewLine
???cAddress1 + cNewLine
IF !EMPTY(cAddress2)
   ???cAddress2 + cNewLine
ENDIF 
???ALLTRIM(cCity) + " " + cState + "  " + cZIP + cNewLine
IF !EMPTY(cAddress2)
   ???cNewLine
ENDIF 

SET PRINTER TO 
SET PRINTER TO


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Hi Dave!
I'm using command like this in my program:

...
SET PRINTER FONT 'Courier New' , 8
LINHA=PROW()
LINHA=LINHA+1
FOR K=1 TO N
M=M+1
@LINHA,((K-1)*32)+ 4 SAY VALOR PICTURE '999999.99'
NEXT K
M=M-N
LINHA=LINHA+1
FOR K=1 TO N
M=M+1
@LINHA,((K-1)*32)+ 4 SAY "DATE: "
@LINHA,((K-1)*32)+10 SAY DATE()
NEXT K
...

As you can see above I use fonts in different sizes.
And using ??? caused the printer to eject too.
 
And in my Epson LX-810 the Properties shows only these types of paper: A4,A5,B5(JIS),Letter and Executive. It doesn't show "Continuous form
 
No Mike, the printer configuration does not have a setting for top and bottom margins.

 
So, the printer thinks it is printing to single sheets (A4 or whatever), but in fact you are using continuous stationery?

If that's right, I find that surprising. Dot matrix printers are designed for continuous stationery. You would think that feeding cut sheets would be an afterthought.

Have checked to see if there is a dip switch setting that tells it to use continuous stationery?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips, training, consultancy
 
Yes Mike, my Epson prints in the whole continuous form. In MS-DOS it prints continuously in tens of sheets without skipping a single line. It writes even on the perforation between 2 sheets.
I noted that in the Paper Size on the Windows, Printers, Configuration, Properties doesn't have "Continuous Form", but just A4,A5,B5(JIS),Letter and Executive paper types.
Thanks,
Tony
 
In MS-DOS it prints continuously...
You have to separate MS-DOS from windows. Two totally different mindsets.
In the old DOS version of Fox, you were printing directly to the printer port.
You can use SET DEVICE TO PRINTER in VFP and use the @..SAY or ??? syntax, in which case you will have to send control codes for your Epson printer embedded in the print statements.

But if you start using the built-in printing functions in VFP like "SET PRINTER FONT 'Courier New' , 8" with an Epson printer driver, you're going to be at the mercy of Windows printer drivers. Windows printer drivers need predefined pages, which of course come with ejects.


-Dave Summers-
[cheers]
Even more Fox stuff at:
 
Dave:
I want to print 200 labels, and don't want it ejects after each 24 labels, because the labels come in continuous form. I think it can eject just after the 200 labels are printed...

Is it possible using VFP (Windows) ?

Thanks, Tony
 
Maybe. :)

You'll probably need to install and use the "Generic Text" printer driver. You won't be able to use SET PRINTER FONT, because the concept of fonts do not exist in GENERIC TEXT.

But, working in your favor, the Generic Text printer driver exists for backwards compatibility with code like this.

It would really be a ton easier if you could use a label form with the appropriate label definition. Then you wouldn't have to mess with any of this. That's what label forms are *for*.
 
Hi Danfreeman !

It seems to work fine now, using Label Form.

Thanks for your advice,

Tony
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top