Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Escape! V3.0 - <b>hpsetup()*</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
hpSetup()*

Configure the laser printer (page size, orientation, and number of copies)
and to select the current typestyle


Syntax

hpSetup(<cFont> [, <cCartridge>] [, <cPagesize> [,<cOrient> [,<nCopies>]]])


Parameters

<cFont>
The name of the desired font to print with.  Font names
for <cFont> which are supported by Escape! can be
found in "Appendix A - Font Selection."  If <cFont> is
omitted, the font type will default to COURIER 10.  If
<cFont> is a soft font, the extension must be included.

<cCartridge>
The letter of the cartridge which contains the font
specified by <cCartridge>.  For example, 'M' or 'S1'.  If
using an internal font, specify 'I' for <cCartridge>.  If a
soft font is being used, specify the null string ''.  If
omitted, <cCartridge> will default to 'I'.

<cPagesize>
The name of the paper size to be loaded in the laser
printer.  The following expressions for <cPagesize> are supported:
"LETTER"        8 1/2' x 11' standard size paper.
"LEGAL"         8 1/2' x 14' paper.
"EXEC"          7 1/4' x 10 1/2' paper.
"A4"            210mm x 297mm paper
"LETENV"        3 7/8' x 7 1/2' Monarch envelope.
"BUSENV"        4 1/8' x 9 1/2' envelope.
"DLENV"         110mm x 220mm International DL envelope.
"C5ENV"         162mm x 229mm International C5 envelope.
If <cPagesize> is omitted the printer's configuration will
not change, only the font will be changed.

<cOrient>
Selects portrait or landscape orientation.  Values for <cOrient> can be:
"P"     Portrait
"L"     Landscape
If <cOrient> is omitted, orientation will default to Portrait.

<nCopies>
The desired number of copies to be printed. <nCopies>
must be a number from 1 to 99.  If <nCopies> is omitted,
Escape! will default the number of copies to 1 (this can
be changed later with hpCopy()).


Returns

0
Successful.

-1
Orientation of the soft font and page orientation do not match.

-2
FNT file not found.

-3
Error reading FNT file, possibly corrupted.

-4
Invalid font name.

-5
Soft font file could not be found.

-6
File error opening soft font.

-7
Could not read soft font format.

-11
Invalid paper size was specified.

-12
Wrong number of parameters passed.

-17
Invalid parameter type was passed.

-18
Font not found in symbol table.

-20
Invalid printer was specified.

-21
Old Escape! .FNT file is being accessed.


Remarks

hpSetup() is included for compatibility with earlier versions of Escape!.
The use of hpSetup() is not recomended because it can be functionally
replaced by hpConfig() and hpSetFont().

hpSetup() must be called at the beginning of your printing applications
any time one of the other Escape! library functions is used.  Besides
setting the font, cartridge, paper size, orientation and number of copies,
hpSetup() also initializes some variables which are critical in order for
the other Escape! library functions to perform properly.

Anytime after, hpSetup() can be called again, to change print
characteristics, such as font or paper size.

It is important that the variables which hpSetup() creates remain in
memory in order for all subsequent Escape! Library function calls to
perform properly.

Before using hpSetup() to select a font other than one of the printer's
internal fonts, remember to make sure the correct cartridge is plugged
into the printer, or the soft font has been downloaded using
hpDownload().

When calling hpSetup() for the first time in your application, the first
three parameters (font name, cartridge, and page size) must be
specified.  Any time after, ie. when changing fonts, only the first two
parameters must be specified (font name and cartridge).

Note:  In order to accomodate the vast number of 3rd party fonts
emerging on the market, a new font standard, called AutoFont, was
created by Hewlett Packard.  Because of this change, replacements for
the hpSetup() function have been developed.  hpSetup() is still
supported for compatability reasons for Escape! ver 2.x users, and can
be used as before; however, the new functions, hpConfig() and
hpSetFont() must now be used to take advantage of the many
improvements in Escape! ver. 3.0.

Note:  The FNT file must be accessible to your application
when this function is executed.  This means that it must reside in either
the current directory, or in one of the directories listed in the
environment variable EPATH.  For a more detailed discussion, see
"Installing" in the chapter "Getting Started".


Support By

All HP Laserjet Printers


Example

This example shows how to use hpSetup() at the beginning of your
program to set up the laser printer:

hpPrintOn()

****
* Select 10 pitch helvetica bold from the
* U cartridge, letter size paper, portrait
* orientation, and print 2 copies of each page.
****

nErr = hpSetup('HELV 10B', 'U', 'LETTER', 'P', 2)
IF nErr < 0
  hpPrintOff()
  RETURN
ENDIF
.
.       // print routine using above    settings
.
hpReset()
hpPrintOff()

This example shows how hpSetup() can be used to change fonts:

hpPrintOn()

****
* Select prestige elite 12 pitch font using the D
* cartridge, legal size paper, landscape orientation
* and print one copy of each page.
****

nErr := hpSetup('PELITE 12', 'D', 'LEGAL','L',1)
IF nErr < 0
  hpPrintOff()
  RETURN
ENDIF
.
.     // print routine using the above settings
.

****
* Change to 10 pitch letter gothic font using the
* R cartridge.
****

nErr := hpSetup('LGOTHIC 10', 'R')
IF nErr < 0
  hpPrintOff()
  RETURN
ENDIF
.
.     // print routine now using letter gothic font
.

hpReset()
hpPrintOff()

Note:  Notice above how only the first two parameters have to be
specified in hpSetup() when only changing fonts.

See Also: hpConfig() hpSetFont() hpCopy() hpPageSize() hpDownload() hpFeed()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson