SECTION 3
Supporting Windows Applications
3-28 PEN*KEY
R
6100 Computer Programmer’s Reference Guide
Special Paper Handling
The PrtService API supports two paperĆhandling options,
PRT_FORWARD
and
PRT_REVERSE
, that should be used with care. They are provided to allow reĆ
ports to be voided" after they have been printed and inspected. Windows mainĆ
tains an internal value that knows" where the current page is relative to the top
of form and end of form. If you use these options, Windows can get confused.
The printer also knows where it is on the page (every 11 inches is a new page,
which may not match the actual paper if the topĆofĆform button is used incorrectĆ
ly). Windows always produces a form feed at the end of a page to advance the
paper to the top of the next page. These options are typically used around the
printers topĆofĆform marker, which confuses things even more. Different sizes of
paper behave differently and may jam the printer.
1. Generate your entire page (may be only half of the page) and call
EndĆ
Page(...)
. This flushes everything printed to the printer and performs a
form feed. This places the print position up at the top of the next page.
2. Call StartPage(...) to reset the Windows device context so that you can do
more output.
3. Use
PRT_FORWARD
to advance the paper far enough so that the user can
determine whether the page is correct. Use a small number of lines, if you
can, especially if you are using multipart forms. If possible, do not advance
at all. This may be possible if you have not printed on the bottom inch of
the page or if the information is not critical. Ask the user to determine
whether the page is correct.
4. Use
PRT_REVERSE
to rewind the paper back into the printer the same
number of lines used in step 3 (assuming the paper is advanced in step 3).
This moves the print position to the top of the form.
5. Use
PRT_REVERSE
to rewind the paper back into the printer to get to the
spot at which to print your validation information. Rewind past the topĆofĆ
form marker so that the
EndPage(...)
in step 7 moves the print position to
the top of the next page. If not rewinded far enough,
EndPage(...)
causes it
to skip an entire page. To print on the last line of the page, a value of 2
works, assuming
TextOut(...)
starts at 0 for the Y value.
6. Use
EndPage(...)
to flush everything printed to the printer and performs a
form feed. The print position moves to the top of the next page and, if
right, Windows is reset so that the next
StartPage(...)
gets things going
again.
Print something on the page regardless of whether the user said the page was
correct. This validates the page only if the valid message is on the page. Errors
can occur while the system attempts to print the void message which may not
appear on the paper. If the absence of a void message means that it is valid, an
invalid page may be accepted as valid if the void message can not be printed.
NPCP Printer Driver Error Codes and Messages
Error # Error Code
Error Message
Explanation
102
PNRDY
Printer Not Ready
Check Connection
Printer not properly connected.
104
RXTMO
Not Receiving
Check Connection
Printer stopped sending data in a packet.
106
TXTMO
Not Transmitting
Check Connection
Printer stopped receiving data in a packet.
3. Windows
Applications
Содержание PEN*KEY 6100
Страница 1: ...PEN KEYR 6100 Computer PROGRAMMER S REFERENCE GUIDE P N 977 054 001 Revision B December 2000 ...
Страница 14: ...CONTENTS xii PEN KEYR 6100 Computer Programmer s Reference Guide ...
Страница 22: ...Preface 8 PEN KEYR 6100 Computer Programmer s Reference Guide PREFACE ...
Страница 112: ...SECTION 4 Power Management 4 10 PEN KEYR 6100 Computer Programmer s Reference Guide 4 Power Management ...
Страница 318: ...GENERAL INDEX Index 6 PEN KEYR 6100 Computer Programmer s Reference Guide ...