Discussion:
Printing To Labels Without Eject
(too old to reply)
Bill Leavy
2009-12-08 23:28:40 UTC
Permalink
Hi Folks -

One of my users has a dot matrix printer that they use to print
continuous form pinfeed labels. I have created a label form for them,
but they need to print the labels one at a time, and after each label
is printed, it ejects three blank labels to correspond with a letter
size paper.

How can I get each label to print, without advancing the additional
pin feed labels. The printer is an Epson LX, and the operating system
is XP.

Thanks to anyone that can help.

-- Bill
TonySper
2009-12-09 00:10:29 UTC
Permalink
Bill,
Maybe you should think of just printing to the printer directly using the
??? commands and the say to printer. Put the info for the labels in a for
loop or do loop and just keep sending the correct amount of commands to fill
the labels by print blanks and carriage returns.
Tonysper
Post by Bill Leavy
Hi Folks -
One of my users has a dot matrix printer that they use to print
continuous form pinfeed labels. I have created a label form for them,
but they need to print the labels one at a time, and after each label
is printed, it ejects three blank labels to correspond with a letter
size paper.
How can I get each label to print, without advancing the additional
pin feed labels. The printer is an Epson LX, and the operating system
is XP.
Thanks to anyone that can help.
-- Bill
Bill Leavy
2009-12-09 06:14:53 UTC
Permalink
Hi Tony -

That's a possibility, but I'm trying to avoid going directly to the
hardware. Will keep it in mind though.

-- Bill



On Tue, 8 Dec 2009 19:10:29 -0500, "TonySper"
Post by TonySper
Bill,
Maybe you should think of just printing to the printer directly using the
??? commands and the say to printer. Put the info for the labels in a for
loop or do loop and just keep sending the correct amount of commands to fill
the labels by print blanks and carriage returns.
Tonysper
Post by Bill Leavy
Hi Folks -
One of my users has a dot matrix printer that they use to print
continuous form pinfeed labels. I have created a label form for them,
but they need to print the labels one at a time, and after each label
is printed, it ejects three blank labels to correspond with a letter
size paper.
How can I get each label to print, without advancing the additional
pin feed labels. The printer is an Epson LX, and the operating system
is XP.
Thanks to anyone that can help.
-- Bill
Dan Freeman
2009-12-09 02:45:44 UTC
Permalink
Post by Bill Leavy
Hi Folks -
One of my users has a dot matrix printer that they use to print
continuous form pinfeed labels. I have created a label form for them,
but they need to print the labels one at a time, and after each label
is printed, it ejects three blank labels to correspond with a letter
size paper.
How can I get each label to print, without advancing the additional
pin feed labels. The printer is an Epson LX, and the operating system
is XP.
Thanks to anyone that can help.
-- Bill
You need to define a custom page size in Windows that is exactly the
height of a single label (assuming your printer driver supports it) and
then use that page size in your VFP label definition. That way when
Windows closes your print job, the advance to top of form takes you to
the next label.

You could try printing line-by-line directly to the printer, but you're
still going through the Windows printer driver system (which is what's
causing your form feeds). As long as the printer driver thinks page size
is letter, that's how far it will advance when a printjob is ended.

Dan
TonySper
2009-12-09 03:57:49 UTC
Permalink
Dan,
Will the printer give a line feed when you are printing continuous pinfeed
labels??? I do not remember my old dot matrix printer doing that. I think I
had to send it page feeds!! The old dot matrix where kind of dumb.
Tony
Post by Dan Freeman
Hi Folks - One of my users has a dot matrix printer that they use to
print
continuous form pinfeed labels. I have created a label form for them,
but they need to print the labels one at a time, and after each label
is printed, it ejects three blank labels to correspond with a letter
size paper.
How can I get each label to print, without advancing the additional
pin feed labels. The printer is an Epson LX, and the operating system
is XP.
Thanks to anyone that can help.
-- Bill
You need to define a custom page size in Windows that is exactly the
height of a single label (assuming your printer driver supports it) and
then use that page size in your VFP label definition. That way when
Windows closes your print job, the advance to top of form takes you to the
next label.
You could try printing line-by-line directly to the printer, but you're
still going through the Windows printer driver system (which is what's
causing your form feeds). As long as the printer driver thinks page size
is letter, that's how far it will advance when a printjob is ended.
Dan
Dan Freeman
2009-12-09 06:20:49 UTC
Permalink
Even the old dot matrix printers dealt with a "page". We had to set page
length to the length of a page of labels (or to a single label), either
through button-pushing on the printer itself or by sending escape codes.

Windows further cements that page orientation because all printing is a
"picture" of a page, and after sending the picture Windows sends a page
feed.

You can bypass printer drivers & such, and probably get something that
will work but sooner or later Windows is going to open or close a print
job and send a page feed.

Dan
Post by TonySper
Dan,
Will the printer give a line feed when you are printing continuous pinfeed
labels??? I do not remember my old dot matrix printer doing that. I think I
had to send it page feeds!! The old dot matrix where kind of dumb.
Tony
Post by Dan Freeman
Hi Folks - One of my users has a dot matrix printer that they use to
print
continuous form pinfeed labels. I have created a label form for them,
but they need to print the labels one at a time, and after each label
is printed, it ejects three blank labels to correspond with a letter
size paper.
How can I get each label to print, without advancing the additional
pin feed labels. The printer is an Epson LX, and the operating system
is XP.
Thanks to anyone that can help.
-- Bill
You need to define a custom page size in Windows that is exactly the
height of a single label (assuming your printer driver supports it) and
then use that page size in your VFP label definition. That way when
Windows closes your print job, the advance to top of form takes you to the
next label.
You could try printing line-by-line directly to the printer, but you're
still going through the Windows printer driver system (which is what's
causing your form feeds). As long as the printer driver thinks page size
is letter, that's how far it will advance when a printjob is ended.
Dan
Bill Leavy
2009-12-09 06:12:06 UTC
Permalink
Hi Dan -

Been a long time since we last talked, good to see you around.

I suspected it might be something like that. So the user would need
to define a customer paper size for the driver on their system, and I
would just need to match that size in the label form? Even though the
page setup on my system says "letter", that would have no bearing as
long as the size of the label form is correct? Is that correct?

How would they define the page size in Windows XP? There seem to be a
couple of places to define a custom size?

Also, how would they assign that paper size as the default for that
printer?

-- Bill
Post by Dan Freeman
Post by Bill Leavy
Hi Folks -
One of my users has a dot matrix printer that they use to print
continuous form pinfeed labels. I have created a label form for them,
but they need to print the labels one at a time, and after each label
is printed, it ejects three blank labels to correspond with a letter
size paper.
How can I get each label to print, without advancing the additional
pin feed labels. The printer is an Epson LX, and the operating system
is XP.
Thanks to anyone that can help.
-- Bill
You need to define a custom page size in Windows that is exactly the
height of a single label (assuming your printer driver supports it) and
then use that page size in your VFP label definition. That way when
Windows closes your print job, the advance to top of form takes you to
the next label.
You could try printing line-by-line directly to the printer, but you're
still going through the Windows printer driver system (which is what's
causing your form feeds). As long as the printer driver thinks page size
is letter, that's how far it will advance when a printjob is ended.
Dan
Dan Freeman
2009-12-09 07:23:55 UTC
Permalink
Hi Bill,

Always good to see you around, too!

Yeah, it's a driver setting and not all drivers support it. <sigh> It's
not the most robust feature of printing in Windows.

They'd need to install a second "printer" (using the same driver) having
the custom paper size, and then print to that.

You'll need the same driver installed on your system or Windows won't
give you the custom paper size for the label definition. You don't need
the actual printer ... just the driver (or another driver that supports
the custom page size that you need).

Dan
Post by Bill Leavy
Hi Dan -
Been a long time since we last talked, good to see you around.
I suspected it might be something like that. So the user would need
to define a customer paper size for the driver on their system, and I
would just need to match that size in the label form? Even though the
page setup on my system says "letter", that would have no bearing as
long as the size of the label form is correct? Is that correct?
How would they define the page size in Windows XP? There seem to be a
couple of places to define a custom size?
Also, how would they assign that paper size as the default for that
printer?
-- Bill
Post by Dan Freeman
Post by Bill Leavy
Hi Folks -
One of my users has a dot matrix printer that they use to print
continuous form pinfeed labels. I have created a label form for them,
but they need to print the labels one at a time, and after each label
is printed, it ejects three blank labels to correspond with a letter
size paper.
How can I get each label to print, without advancing the additional
pin feed labels. The printer is an Epson LX, and the operating system
is XP.
Thanks to anyone that can help.
-- Bill
You need to define a custom page size in Windows that is exactly the
height of a single label (assuming your printer driver supports it) and
then use that page size in your VFP label definition. That way when
Windows closes your print job, the advance to top of form takes you to
the next label.
You could try printing line-by-line directly to the printer, but you're
still going through the Windows printer driver system (which is what's
causing your form feeds). As long as the printer driver thinks page size
is letter, that's how far it will advance when a printjob is ended.
Dan
Beverly Howard
2009-12-09 03:58:59 UTC
Permalink
Best approach is to bypass any windows printer "driver" and print ascii
text directly to the printer port.

Step one, initialize the printer to a form length equal to the height of
a label... doing so allows you to use form feeds to assure that you are
at the top of the next label. In addition to setting the form length
using software codes, most dot matrix printers allow some way of setting
the printer to a specific form length as the default power on state.

Further, doing this allows the users to advance the labels out to tear
off using the printer FF or even LF controls... you issue a FF at the
start of the next job and the next label is correctly positioned.

next, use the printer setup or initialization to set the font format you
want to use for all text... that then allows you to send ascii text only
output to the printer which is not only simpler, but much faster.

What printer? fwiw, I have some sample Epson code if the printer can
emulate the Epson commands.

Beverly Howard
Bill Leavy
2009-12-09 06:24:48 UTC
Permalink
Hi Beverly -

Trying to avoid going directly to the hardware, but I might have to.

Printer is an Epson LX300+.

Would appreciate any sample code you might have.

-- Bill



On Tue, 08 Dec 2009 21:58:59 -0600, Beverly Howard
Post by Beverly Howard
Best approach is to bypass any windows printer "driver" and print ascii
text directly to the printer port.
Step one, initialize the printer to a form length equal to the height of
a label... doing so allows you to use form feeds to assure that you are
at the top of the next label. In addition to setting the form length
using software codes, most dot matrix printers allow some way of setting
the printer to a specific form length as the default power on state.
Further, doing this allows the users to advance the labels out to tear
off using the printer FF or even LF controls... you issue a FF at the
start of the next job and the next label is correctly positioned.
next, use the printer setup or initialization to set the font format you
want to use for all text... that then allows you to send ascii text only
output to the printer which is not only simpler, but much faster.
What printer? fwiw, I have some sample Epson code if the printer can
emulate the Epson commands.
Beverly Howard
Beverly Howard
2009-12-09 16:56:33 UTC
Permalink
Actually sent the code here last night but it seems something didn't
like the content... just tried again.
direct to hardware <<
Actually, that's not necessary... you can define (or create a second
instance of) the epson as "generic, text only" which then goes through
the windows printer schema but allows anything sent to be passed without
"editing" by a pictorial printer driver.

Also, you will see in the sample code that the printer address is the
windows printer address and not a hardware address.

From my experience, the cost factor is comparing the time spent and
wasted trying to get this type of output through a driver vs the time
needed to look up the printer codes and implement them in an app.

Beverly Howard
Beverly Howard
2009-12-09 17:19:20 UTC
Permalink
Looks like my sample code is being held hostage by microsoft's excellent
forum junk filter ;-/ ...so much for this being a programmers' support
group ;-)

Is that your real email address? If not, send me a heads up _using a
mailto on my website_ and I will send the code directly to you.

Beverly Howard
Beverly Howard
2009-12-09 17:30:08 UTC
Permalink
Better solution

http://bevhoward.com/stuff/Ref/DotControlCode.prg.txt

hth,
Beverly Howard
Bill Leavy
2009-12-09 19:00:20 UTC
Permalink
Hi Beverly -

Thanks for your persistance. Will look at this in a little while.

-- Bill



On Wed, 09 Dec 2009 11:30:08 -0600, Beverly Howard
Post by Beverly Howard
Better solution
http://bevhoward.com/stuff/Ref/DotControlCode.prg.txt
hth,
Beverly Howard
Bill Leavy
2009-12-09 21:09:23 UTC
Permalink
Hi Beverly -

This was very helpful. I'm going to pursue the other method that
Woody mentioned as well and then decide which works better for my
purposes. A few questions though...
Post by Beverly Howard
??? CHR(27) + "C" + CHR(18) && set form length to label length
&& do while ????? ...this example for a single label...
&& select and loop until eof() or equivalent for multiples
??? CHR(27) + CHR(1) && nlq mode
*??? CHR(27) + && use this to build other esc codes
It seems to me that the nlq mode and probably other escape codes
should be moved before the loop. Any reason not to do this?
Post by Beverly Howard
??? CHR(27) + "C" + CHR(18) && set form length to label length
How do I set the correct form length? The form length should be 3 and
1/16 inches.
Post by Beverly Howard
??? CHR(27) + "C" + CHR(18) && set form length to label length
The escape codes at the beginning, this and the nlq mode add a couple
of garbage characters at the beginning of the first label, all
subsequent labels are ok. How do I prevent these garbage codes? This
may be due to the fact that I'm testing on a LaserJet, but figured I'd
ask anyway.
Post by Beverly Howard
*??? CHR(27) + && use this to build other esc codes
What other escape codes might I want to use?

Thanks again for your help, I think this should be workable.

-- Bill







On Wed, 09 Dec 2009 11:30:08 -0600, Beverly Howard
Post by Beverly Howard
Better solution
http://bevhoward.com/stuff/Ref/DotControlCode.prg.txt
hth,
Beverly Howard
Jürgen Wondzinski
2009-12-09 22:51:52 UTC
Permalink
Hi Bill
Post by Bill Leavy
What other escape codes might I want to use?
ESC-Codes are very printer specific. Depending on your printer model, it may
or may not understand those codes. That's why you see that garbage on the
first printout.

But just a friendly tip: Bypassing the whole Windows printer environment
will get you lots of other headaches. Not only is it soo.. so retro ;), it's
just cumbersome. And designing your labels is not VISUAL. The easiest way is
always to work with a tool (or environemnt) the way the inventors decided
it.

Windows has a very well working printer handling, with lots of invisible
technologies. Why would you want to loose all that functionality? Just
think about: what would you do, if the user changes his printer? Or going
from LPT1 to USB002? Or is now attaching a network-connected printer? Maybe
even a printer pool?
How do you switch from Arial to Verdana? (You can't, because in that direct
way, you only have the printer-builtin fonts available)

Long story short: Beverly's code is a typical DOS code, where life (and
hardware) was a lot simpler. (Sorry Beverly! ;) ) It doessn't really fit to
todays possibilities. (Just for starters: Try to find the ESC sequence
documentation for your printer)

If you really want to directly control the printer, at least take a look at
the gotchas of the "???" command. I have once written a wiki entry for that:
http://fox.wikis.com/wc.dll?Wiki~???~VFP
--
wOOdy
Visual FoxPro Evangelist
Microsoft "Most Valuable Professional" 1996 to 2009



"*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
..·`.Visual FoxPro: It's magic !
(¸.·``··*
Beverly Howard
2009-12-10 00:01:00 UTC
Permalink
I have to differ on several points... and that includes a number of
times where I have been called in to fix setups that used those "Windows
printer environment" setups.
Post by Jürgen Wondzinski
ESC-Codes are very printer specific. Depending on your printer
model, it may or may not understand those codes. That's why you see that
garbage on the first printout. <<

The Epson codes are very standardized for dot matrix printers. Even the
Okidata as well as many other oems either use or offer "Epson Emulation"

Newer models may have additional codes such a NLQ but all Epsons use the
same base commands.
Post by Jürgen Wondzinski
But just a friendly tip: Bypassing the whole Windows printer
environment will get you lots of other headaches. Not only is it soo..
so retro ;) , it's just cumbersome. And designing your labels is not
VISUAL. The easiest way is always to work with a tool (or environemnt)
the way the inventors decided it. <<

There are significant penalties to using the "VISUAL" environment...
while it can be pretty neat to use an obscure font or print a logo on a
mailing label, the print speed difference using native dot matrix output
over bitmap printing is huge and can add up to hours saved on a single
large job.
Post by Jürgen Wondzinski
Windows has a very well working printer handling, with lots of
invisible technologies. Why would you want to loose all that
functionality? <<

Printing to a Dot Matrix printer is normally grunt level work, and those
who actually have to work and live with dot matrix printers in the same
room tend to appreciate short, quiet print jobs. If appearance is
important, then, I agree, it's time for VISUAL approach and that
includes using something other than a dot matrix printer ;-)
Post by Jürgen Wondzinski
http://fox.wikis.com/wc.dll?Wiki~???~VFP <<
Thanks...

Beverly Howard
Bill Leavy
2009-12-10 00:58:32 UTC
Permalink
Hi Woody -

I'm actually trying both your method and Bev's method and I'll pick
from the two, I'm doing both for the education <grin>. I started off
with your method, but ran into a hangup assigning the paper size to my
specific printer. I actually left you a message about it over in the
printing forum tied in to the thread over there that you recommended.

Some of the things that you say were the reason I was hesitant to
write directly to the printer, but Beverly's code is fairly
straightforward, and if I can't get things working through the Windows
printing system, at least it provides an alternative.

Please take a look at my message to you in the other forum. Maybe you
can help me get over the hump I ran into,

Thanks for all your help.

-- Bill




On Wed, 9 Dec 2009 23:51:52 +0100, Jürgen Wondzinski
Post by Dan Freeman
Hi Bill
Post by Bill Leavy
What other escape codes might I want to use?
ESC-Codes are very printer specific. Depending on your printer model, it may
or may not understand those codes. That's why you see that garbage on the
first printout.
But just a friendly tip: Bypassing the whole Windows printer environment
will get you lots of other headaches. Not only is it soo.. so retro ;), it's
just cumbersome. And designing your labels is not VISUAL. The easiest way is
always to work with a tool (or environemnt) the way the inventors decided
it.
Windows has a very well working printer handling, with lots of invisible
technologies. Why would you want to loose all that functionality? Just
think about: what would you do, if the user changes his printer? Or going
from LPT1 to USB002? Or is now attaching a network-connected printer? Maybe
even a printer pool?
How do you switch from Arial to Verdana? (You can't, because in that direct
way, you only have the printer-builtin fonts available)
Long story short: Beverly's code is a typical DOS code, where life (and
hardware) was a lot simpler. (Sorry Beverly! ;) ) It doessn't really fit to
todays possibilities. (Just for starters: Try to find the ESC sequence
documentation for your printer)
If you really want to directly control the printer, at least take a look at
http://fox.wikis.com/wc.dll?Wiki~???~VFP
Beverly Howard
2009-12-09 22:56:25 UTC
Permalink
before loop <<
busted... I started by grabbing code for a single label then tried to
mod it as a tutorial...

good catch.
garbage characters <<
nope... correctly issued codes will not result in any printer output.
note that they are not followed by a crlf
form length <<
??? CHR(27) + "C" + CHR(18)

In this example;

Esc "C" followed by value of 18 lines ...note, the "value" is the ascii
character value, _not_ a "number" (CHR(18) actually sends a single byte
containing the binary value "18")

There are also multiple commands to set line spacing down to increments
of 1/216"
3 and 1/16 inches <<
Check the label specs... the perf interval may be different than the
label itself... the perf interval interval is what you want to set, for
example, 15/16" labels have a 1" interval ...the 1/16" gives me pause.

However, the label/pin/printer dimensions are extremely accurate... the
standard is 6 lines/inch and would bet that the interval is a multiple
of 1/6" Once set, you should be able to print thousands of labels with
no adjustment.


If you are going to get into this, get a good Epson reference and put it
in a safe place.

http://lprng.sourceforge.net/DISTRIB/RESOURCES/PPD/epson.htm

in addition, go the extra mile and "over document" any code that uses
these codes... reason, tends to be years between needs to open the code
such as changing the label length.

Also, put the printer manual in a safe place... I normally tell the
client that I will be the keeper of the manual and to order a second one
for onsite if needed... pdf manuals have made this a bit easier.
other escape codes <<
There are many escape codes... my 1983 RX-80 had 54 commands, for
example bold and unbold, character size, etc, etc. ...very useful on
labels... for example, printing reference codes upper right in tiny
print in addition to address information.

hth,
Beverly Howard
Bill Leavy
2009-12-10 01:10:14 UTC
Permalink
Hi Beverly -
Post by Beverly Howard
nope... correctly issued codes will not result in any printer output.
note that they are not followed by a crlf
So can I assume that this is due to the fact that I'm using a
LaserJet, and that they won't appear on the user's printer?
Post by Beverly Howard
Check the label specs... the perf interval may be different than the
label itself... the perf interval interval is what you want to set, for
example, 15/16" labels have a 1" interval ...the 1/16" gives me pause.
I did allow for the perf intervals, I'm going from the top of one
label to the top of the next.

Unfortunately I don't have the labels here, they are at the clients
site. I asked them to measure and they told me 2 and 15/16 with 1/8
between labels.

I'll set it up to the nearest 1/6 measurement and see how we do.

Thanks again.

-- Bill






On Wed, 09 Dec 2009 16:56:25 -0600, Beverly Howard
Post by Beverly Howard
before loop <<
busted... I started by grabbing code for a single label then tried to
mod it as a tutorial...
good catch.
garbage characters <<
nope... correctly issued codes will not result in any printer output.
note that they are not followed by a crlf
form length <<
??? CHR(27) + "C" + CHR(18)
In this example;
Esc "C" followed by value of 18 lines ...note, the "value" is the ascii
character value, _not_ a "number" (CHR(18) actually sends a single byte
containing the binary value "18")
There are also multiple commands to set line spacing down to increments
of 1/216"
3 and 1/16 inches <<
Check the label specs... the perf interval may be different than the
label itself... the perf interval interval is what you want to set, for
example, 15/16" labels have a 1" interval ...the 1/16" gives me pause.
However, the label/pin/printer dimensions are extremely accurate... the
standard is 6 lines/inch and would bet that the interval is a multiple
of 1/6" Once set, you should be able to print thousands of labels with
no adjustment.
If you are going to get into this, get a good Epson reference and put it
in a safe place.
http://lprng.sourceforge.net/DISTRIB/RESOURCES/PPD/epson.htm
in addition, go the extra mile and "over document" any code that uses
these codes... reason, tends to be years between needs to open the code
such as changing the label length.
Also, put the printer manual in a safe place... I normally tell the
client that I will be the keeper of the manual and to order a second one
for onsite if needed... pdf manuals have made this a bit easier.
other escape codes <<
There are many escape codes... my 1983 RX-80 had 54 commands, for
example bold and unbold, character size, etc, etc. ...very useful on
labels... for example, printing reference codes upper right in tiny
print in addition to address information.
hth,
Beverly Howard
Kevin Clark
2009-12-10 16:41:03 UTC
Permalink
I use a VCX called RawPrint for sending text directly to the printer.
It works pretty well. You can find it on UniversalThread. Just
search for RawPrint.

Kevin Clark
Beverly Howard
2009-12-10 20:48:42 UTC
Permalink
Post by Bill Leavy
So can I assume that this is due to the fact that I'm using a
LaserJet, and that they won't appear on the user's printer? <<

Yes... the HP codes are completely unrelated to Epson's, so the HP
assumes that Epson codes should be printed.
Post by Bill Leavy
Unfortunately I don't have the labels here <<
Can you get someone at the client's office to give you the "Avery
Number" which most labels have even if they are not "Avery" if not that,
what's printed on the package. Post here, and if it's not a multiple of
1/6" will suggest a couple of other commands to set the line spacing.

Beverly Howard
Bill Leavy
2009-12-10 23:36:48 UTC
Permalink
Hi Beverly -

I already asked about the Avery numbers, but apparently they're not
Avery labels. In any case, I've got it working over there with 3 inch
spacing, and it doesn't seem to be creeping up or down. Also, escape
codes are not printing on their Epson, so it looks like we're ok.
Thanks again for the help.

-- Bill



On Thu, 10 Dec 2009 14:48:42 -0600, Beverly Howard
Post by Beverly Howard
Post by Bill Leavy
So can I assume that this is due to the fact that I'm using a
LaserJet, and that they won't appear on the user's printer? <<
Yes... the HP codes are completely unrelated to Epson's, so the HP
assumes that Epson codes should be printed.
Post by Bill Leavy
Unfortunately I don't have the labels here <<
Can you get someone at the client's office to give you the "Avery
Number" which most labels have even if they are not "Avery" if not that,
what's printed on the package. Post here, and if it's not a multiple of
1/6" will suggest a couple of other commands to set the line spacing.
Beverly Howard
Beverly Howard
2009-12-11 00:13:14 UTC
Permalink
congrats!

Beverly Howard
Jürgen Wondzinski
2009-12-09 08:30:32 UTC
Permalink
Hi Bill,

some days ago I answered a similar question over in the
.fox.vfp.reports.printing group (where your question should have been anyway
;) )
--
wOOdy
Visual FoxPro Evangelist
Microsoft "Most Valuable Professional" 1996 to 2009



"*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
..·`.Visual FoxPro: It's magic !
(¸.·``··*
Bill Leavy
2009-12-09 14:58:24 UTC
Permalink
Thanks Woody, I'll head over there now and take a look.

-- Bill



On Wed, 9 Dec 2009 09:30:32 +0100, Jürgen Wondzinski
Post by Dan Freeman
Hi Bill,
some days ago I answered a similar question over in the
.fox.vfp.reports.printing group (where your question should have been anyway
;) )
unknown
2009-12-12 02:20:48 UTC
Permalink
Read printer manual and select page back properly
Or paper size, or top margin or bottom margin




Bill Leavy wrote:

Printing To Labels Without Eject
08-Dec-09

Hi Folks

One of my users has a dot matrix printer that they use to prin
continuous form pinfeed labels. I have created a label form for them
but they need to print the labels one at a time, and after each labe
is printed, it ejects three blank labels to correspond with a lette
size paper

How can I get each label to print, without advancing the additiona
pin feed labels. The printer is an Epson LX, and the operating syste
is XP

Thanks to anyone that can help

-- Bill

Previous Posts In This Thread:


Submitted via EggHeadCafe - Software Developer Portal of Choice
EggHeadCafe in Silverlight Release Candidate Now Available
http://www.eggheadcafe.com/tutorials/aspnet/26f7266a-3ae3-4c24-903f-98f78bf38458/eggheadcafe-in-silverligh.aspx
arvind kothari
2011-01-29 07:03:59 UTC
Permalink
dear
i am working in foxpro 2.6
I have proble to set page height & continue label
printing without page eject
tell me how to set page height in inches

i prepare reports with @ say & set device to
printer or set device to screen

i dont use foxpro report tool
Post by Bill Leavy
Hi Folks -
One of my users has a dot matrix printer that they use to print
continuous form pinfeed labels. I have created a label form for them,
but they need to print the labels one at a time, and after each label
is printed, it ejects three blank labels to correspond with a letter
size paper.
How can I get each label to print, without advancing the additional
pin feed labels. The printer is an Epson LX, and the operating system
is XP.
Thanks to anyone that can help.
-- Bill
Post by TonySper
Bill,
Maybe you should think of just printing to the printer directly using the
??? commands and the say to printer. Put the info for the labels in a for
loop or do loop and just keep sending the correct amount of commands to fill
the labels by print blanks and carriage returns.
Tonysper
Post by Dan Freeman
You need to define a custom page size in Windows that is exactly the
height of a single label (assuming your printer driver supports it) and
then use that page size in your VFP label definition. That way when
Windows closes your print job, the advance to top of form takes you to
the next label.
You could try printing line-by-line directly to the printer, but you are
still going through the Windows printer driver system (which is what is
causing your form feeds). As long as the printer driver thinks page size
is letter, that is how far it will advance when a printjob is ended.
Dan
Post by TonySper
Dan,
Will the printer give a line feed when you are printing continuous pinfeed
labels??? I do not remember my old dot matrix printer doing that. I think I
had to send it page feeds!! The old dot matrix where kind of dumb.
Tony
Post by Beverly Howard
Best approach is to bypass any windows printer "driver" and print ascii
text directly to the printer port.
Step one, initialize the printer to a form length equal to the height of
a label... doing so allows you to use form feeds to assure that you are
at the top of the next label. In addition to setting the form length
using software codes, most dot matrix printers allow some way of setting
the printer to a specific form length as the default power on state.
Further, doing this allows the users to advance the labels out to tear
off using the printer FF or even LF controls... you issue a FF at the
start of the next job and the next label is correctly positioned.
next, use the printer setup or initialization to set the font format you
want to use for all text... that then allows you to send ascii text only
output to the printer which is not only simpler, but much faster.
What printer? fwiw, I have some sample Epson code if the printer can
emulate the Epson commands.
Beverly Howard
Post by Bill Leavy
Hi Dan -
Been a long time since we last talked, good to see you around.
I suspected it might be something like that. So the user would need
to define a customer paper size for the driver on their system, and I
would just need to match that size in the label form? Even though the
page setup on my system says "letter", that would have no bearing as
long as the size of the label form is correct? Is that correct?
How would they define the page size in Windows XP? There seem to be a
couple of places to define a custom size?
Also, how would they assign that paper size as the default for that
printer?
-- Bill
Post by Bill Leavy
Hi Tony -
That's a possibility, but I am trying to avoid going directly to the
hardware. Will keep it in mind though.
-- Bill
Post by Dan Freeman
Even the old dot matrix printers dealt with a "page". We had to set page
length to the length of a page of labels (or to a single label), either
through button-pushing on the printer itself or by sending escape codes.
Windows further cements that page orientation because all printing is a
"picture" of a page, and after sending the picture Windows sends a page
feed.
You can bypass printer drivers & such, and probably get something that
will work but sooner or later Windows is going to open or close a print
job and send a page feed.
Dan
Post by Bill Leavy
Hi Beverly -
Trying to avoid going directly to the hardware, but I might have to.
Printer is an Epson LX300+.
Would appreciate any sample code you might have.
-- Bill
Post by Dan Freeman
Hi Bill,
Always good to see you around, too!
Yeah, it is a driver setting and not all drivers support it. <sigh> it is
not the most robust feature of printing in Windows.
They'd need to install a second "printer" (using the same driver) having
the custom paper size, and then print to that.
You'll need the same driver installed on your system or Windows will not
give you the custom paper size for the label definition. You do not need
the actual printer ... just the driver (or another driver that supports
the custom page size that you need).
Dan
Post by Dan Freeman
Hi Bill,
some days ago I answered a similar question over in the
.fox.vfp.reports.printing group (where your question should have been anyway
;) )
--
wOOdy
Visual FoxPro Evangelist
Microsoft "Most Valuable Professional" 1996 to 2009
"*??)
?.???.?*??) ?.?*?)
(?.??. (?.?` *
..?`.Visual FoxPro: it is magic !
(?.?``??*
Thanks Woody, I will head over there now and take a look.
-- Bill
Actually sent the code here last night but it seems something did not
like the content... just tried again.
Actually, that is not necessary... you can define (or create a second
instance of) the epson as "generic, text only" which then goes through
the windows printer schema but allows anything sent to be passed without
"editing" by a pictorial printer driver.
Also, you will see in the sample code that the printer address is the
windows printer address and not a hardware address.
From my experience, the cost factor is comparing the time spent and
wasted trying to get this type of output through a driver vs the time
needed to look up the printer codes and implement them in an app.
Beverly Howard
Post by Beverly Howard
Looks like my sample code is being held hostage by microsoft's excellent
forum junk filter ;-/ ...so much for this being a programmers' support
group ;-)
Is that your real email address? If not, send me a heads up _using a
mailto on my website_ and I will send the code directly to you.
Beverly Howard
Post by Beverly Howard
Better solution
http://bevhoward.com/stuff/Ref/DotControlCode.prg.txt
hth,
Beverly Howard
Post by Bill Leavy
Hi Beverly -
Thanks for your persistance. Will look at this in a little while.
-- Bill
Post by Bill Leavy
Hi Beverly -
This was very helpful. I am going to pursue the other method that
Woody mentioned as well and then decide which works better for my
purposes. A few questions though...
It seems to me that the nlq mode and probably other escape codes
should be moved before the loop. Any reason not to do this?
How do I set the correct form length? The form length should be 3 and
1/16 inches.
The escape codes at the beginning, this and the nlq mode add a couple
of garbage characters at the beginning of the first label, all
subsequent labels are ok. How do I prevent these garbage codes? This
may be due to the fact that I am testing on a LaserJet, but figured I'd
ask anyway.
What other escape codes might I want to use?
Thanks again for your help, I think this should be workable.
-- Bill
Post by Dan Freeman
Hi Bill
ESC-Codes are very printer specific. Depending on your printer model, it may
or may not understand those codes. That's why you see that garbage on the
first printout.
But just a friendly tip: Bypassing the whole Windows printer environment
will get you lots of other headaches. Not only is it soo.. so retro ;), it is
just cumbersome. And designing your labels is not VISUAL. The easiest way is
always to work with a tool (or environemnt) the way the inventors decided
it.
Windows has a very well working printer handling, with lots of invisible
technologies. Why would you want to loose all that functionality? Just
think about: what would you do, if the user changes his printer? Or going
from LPT1 to USB002? Or is now attaching a network-connected printer? Maybe
even a printer pool?
How do you switch from Arial to Verdana? (You cannot, because in that direct
way, you only have the printer-builtin fonts available)
Long story short: Beverly's code is a typical DOS code, where life (and
hardware) was a lot simpler. (Sorry Beverly! ;) ) It doessn't really fit to
todays possibilities. (Just for starters: Try to find the ESC sequence
documentation for your printer)
If you really want to directly control the printer, at least take a look at
http://fox.wikis.com/wc.dll?Wiki~???~VFP
--
wOOdy
Visual FoxPro Evangelist
Microsoft "Most Valuable Professional" 1996 to 2009
"*??)
?.???.?*??) ?.?*?)
(?.??. (?.?` *
..?`.Visual FoxPro: it is magic !
(?.?``??*
Post by Beverly Howard
busted... I started by grabbing code for a single label then tried to
mod it as a tutorial...
good catch.
nope... correctly issued codes will not result in any printer output.
note that they are not followed by a crlf
??? CHR(27) + "C" + CHR(18)
In this example;
Esc "C" followed by value of 18 lines ...note, the "value" is the ascii
character value, _not_ a "number" (CHR(18) actually sends a single byte
containing the binary value "18")
There are also multiple commands to set line spacing down to increments
of 1/216"
Check the label specs... the perf interval may be different than the
label itself... the perf interval interval is what you want to set, for
example, 15/16" labels have a 1" interval ...the 1/16" gives me pause.
However, the label/pin/printer dimensions are extremely accurate... the
standard is 6 lines/inch and would bet that the interval is a multiple
of 1/6" Once set, you should be able to print thousands of labels with
no adjustment.
If you are going to get into this, get a good Epson reference and put it
in a safe place.
http://lprng.sourceforge.net/DISTRIB/RESOURCES/PPD/epson.htm
in addition, go the extra mile and "over document" any code that uses
these codes... reason, tends to be years between needs to open the code
such as changing the label length.
Also, put the printer manual in a safe place... I normally tell the
client that I will be the keeper of the manual and to order a second one
for onsite if needed... pdf manuals have made this a bit easier.
There are many escape codes... my 1983 RX-80 had 54 commands, for
example bold and unbold, character size, etc, etc. ...very useful on
labels... for example, printing reference codes upper right in tiny
print in addition to address information.
hth,
Beverly Howard
Post by Beverly Howard
I have to differ on several points... and that includes a number of
times where I have been called in to fix setups that used those "Windows
printer environment" setups.
model, it may or may not understand those codes. That's why you see that
garbage on the first printout. <<
The Epson codes are very standardized for dot matrix printers. Even the
Okidata as well as many other oems either use or offer "Epson Emulation"
Newer models may have additional codes such a NLQ but all Epsons use the
same base commands.
environment will get you lots of other headaches. Not only is it soo..
so retro ;) , it is just cumbersome. And designing your labels is not
VISUAL. The easiest way is always to work with a tool (or environemnt)
the way the inventors decided it. <<
There are significant penalties to using the "VISUAL" environment...
while it can be pretty neat to use an obscure font or print a logo on a
mailing label, the print speed difference using native dot matrix output
over bitmap printing is huge and can add up to hours saved on a single
large job.
invisible technologies. Why would you want to loose all that
functionality? <<
Printing to a Dot Matrix printer is normally grunt level work, and those
who actually have to work and live with dot matrix printers in the same
room tend to appreciate short, quiet print jobs. If appearance is
important, then, I agree, it is time for VISUAL approach and that
includes using something other than a dot matrix printer ;-)
Thanks...
Beverly Howard
Post by Bill Leavy
Hi Woody -
I am actually trying both your method and Bev's method and I will pick
from the two, I am doing both for the education <grin>. I started off
with your method, but ran into a hangup assigning the paper size to my
specific printer. I actually left you a message about it over in the
printing forum tied in to the thread over there that you recommended.
Some of the things that you say were the reason I was hesitant to
write directly to the printer, but Beverly's code is fairly
straightforward, and if I cannot get things working through the Windows
printing system, at least it provides an alternative.
Please take a look at my message to you in the other forum. Maybe you
can help me get over the hump I ran into,
Thanks for all your help.
-- Bill
Post by Bill Leavy
Hi Beverly -
So can I assume that this is due to the fact that I am using a
LaserJet, and that they will not appear on the user's printer?
I did allow for the perf intervals, I am going from the top of one
label to the top of the next.
Unfortunately I do not have the labels here, they are at the clients
site. I asked them to measure and they told me 2 and 15/16 with 1/8
between labels.
I will set it up to the nearest 1/6 measurement and see how we do.
Thanks again.
-- Bill
Post by Kevin Clark
I use a VCX called RawPrint for sending text directly to the printer.
It works pretty well. You can find it on UniversalThread. Just
search for RawPrint.
Kevin Clark
LaserJet, and that they will not appear on the user's printer? <<
Yes... the HP codes are completely unrelated to Epson's, so the HP
assumes that Epson codes should be printed.
Can you get someone at the client's office to give you the "Avery
Number" which most labels have even if they are not "Avery" if not that,
what is printed on the package. Post here, and if it is not a multiple of
1/6" will suggest a couple of other commands to set the line spacing.
Beverly Howard
Post by Bill Leavy
Hi Beverly -
I already asked about the Avery numbers, but apparently they are not
Avery labels. In any case, I have got it working over there with 3 inch
spacing, and it does not seem to be creeping up or down. Also, escape
codes are not printing on their Epson, so it looks like we are ok.
Thanks again for the help.
-- Bill
Post by Beverly Howard
congrats!
Beverly Howard
Post by unknown
Read printer manual and select page back properly
Or paper size, or top margin or bottom margin
Submitted via EggHeadCafe
Creating Google Motion Charts from Excel data
http://www.eggheadcafe.com/tutorials/aspnet/86599bca-edda-4204-af15-7a1cf901a071/creating-google-motion-charts-from-excel-data.aspx
Bernhard Sander
2011-01-31 09:31:44 UTC
Permalink
Hi arvind kothari,
Post by arvind kothari
i am working in foxpro 2.6
I have proble to set page height & continue label
printing without page eject
tell me how to set page height in inches
printer or set device to screen
i dont use foxpro report tool
If you use this very old fashioned way of printing, you may take a look at
_PADVANCE, _PLENGTH, _PLINENO system variables and at ON PAGE and EJECT PAGE
commands in help.

Regards
Bernhard Sander

Loading...