Question on printerhandling

H

Huub

Hi,

In a dBase program someone used "eject" to eject the sheet from the
printer and position the printer on top of the next sheet. Looking
through CPAN, I found no such command or description. Is there any (did
I miss it?) or is there some workaround possible?

Thanks,

Huub
 
H

Huub

Unfortunately "/f" feeds an empty page before positioning on top. Any
idea how I can avoid that?

Thanks for helping out.
 
D

Dr.Ruud

Huub" <"v.niekerk at hccnet.nl schreef:
Unfortunately "/f" feeds an empty page before positioning on top. Any
idea how I can avoid that?

Thanks for helping out.

ITYM: "\f" (formfeed).

Maybe your previous page has already printed white lines on the new
page. Print something like "test\f" to see were the "test" lands.
 
A

anno4000

Huub said:
Unfortunately "/f" feeds an empty page before positioning on top. Any
idea how I can avoid that?

A form feed goes to the top of the next page. It should skip the
remaining lines on the current page but not eject completely blank
page (except possibly when it is already at the top of a page).
If you get blank pages your printer isn't interpreting form feed
correctly.

Anno
 
H

Huub

ITYM: "\f" (formfeed).

Oops, typo..I do use "\f".
Maybe your previous page has already printed white lines on the new
page. Print something like "test\f" to see were the "test" lands.

It appears that "test\f" lands on that blank ff page. I'm printing 2
regular pages for testing (costs too much otherwise), and in the code
everything is ok. The first page is printed 100% correctly. Not 1
character too much. Then your test appears on that "\f" page, after
which the 2nd page is printed 100% correctly as well. BTW, "test" is
printed at the same line as the regular next-page text is printed
without using "\f".
In the old dBase code, "eject" is used on the same printer which works
as should. The Perl code is a replacement of the dBase code. I just had
to align some text and figure out the number of empty lines between the
text to fit the form. So, except for the "eject", it's the same.

I hope the above makes (some) sense.

Thank you for helping out.
 
D

Dr.Ruud

Huub schreef:
Ruud:

It appears that "test\f" lands on that blank ff page. I'm printing 2
regular pages for testing (costs too much otherwise), and in the code
everything is ok. The first page is printed 100% correctly. Not 1
character too much. Then your test appears on that "\f" page, after
which the 2nd page is printed 100% correctly as well. " BTW, "test" is
printed at the same line as the regular next-page text is printed
without using "\f".

So it seems that your printing logic is already "on the next page". So
why do you add the "\f"?

Many HP Laser printer have by default 66 lines on a page. Of course you
can send setup codes to it, to make that a lot more.
But by default, after you have sent 66 lines, you will be on the next
page already.

In the old dBase code, "eject" is used on the same printer which works
as should. The Perl code is a replacement of the dBase code. I just
had to align some text and figure out the number of empty lines
between the text to fit the form. So, except for the "eject", it's
the same.

I would let it print to a file, and check the special codes in the file.
 
H

Huub

So it seems that your printing logic is already "on the next page". So
why do you add the "\f"?

Because it is an attempt to position the printer on top of the next
page. Without the "\f", it is on the next page, but 6 lines from the top.
Many HP Laser printer have by default 66 lines on a page. Of course you
can send setup codes to it, to make that a lot more.
But by default, after you have sent 66 lines, you will be on the next
page already.

Should have mentioned this earlier: it's an HP DeskJet 520, very well
capable of printing ASCII. The old dBase code proves that, and I didn't
change the settings of the printer.
I would let it print to a file, and check the special codes in the file.

That's an idea. Does Perl insert special or hidden codes?
 
D

Dr.Ruud

Huub:

Without the "\f", it is on the next page, but 6 lines from the top.

66+6 is 72, so maybe dBase told the printer to accept 72 lines per page.
Does Perl insert special or hidden codes?

No, but you haven't shown any code yet, so maybe you are. Or dBase was.
(Try to make the old dBase program print to a file as well, and diff the
results.)
 
H

Huub

Problem is solved: last empty lines of the page put into an
"if"-statement. Wonder why I didn't think of that earlier. Together with
the "\f" it's perfect.
Thank you for helping out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,176
Messages
2,570,950
Members
47,500
Latest member
ArianneJsb

Latest Threads

Top