Important: The information in this document is obsolete and should not be used for new development.
PrOpenDoc
Use thePrOpenDoc
function to initialize a printing graphics port for use in printing a document.
FUNCTION PrOpenDoc (hPrint: THPrint; pPrPort: TPPrPort; pIOBuf: Ptr): TPPrPort;
hPrint
- A handle to a
TPrint
record (described on page 9-41), which may be a new record or an existing one from a document. You should call thePrintDefault
procedure (described on page 9-56) or thePrValidate
function (described on page 9-57) for thisTPrint
record before callingPrOpenDoc
.pPrPort
- A pointer to a printing graphics port. If you set this parameter to
NIL
,PrOpenDoc
allocates a new printing graphics port in the heap.pIOBuf
- A pointer to an area of memory to be used as an input and output buffer. If you set this parameter to
NIL
,PrOpenDoc
uses the volume buffer for the deferred spool file's volume. If you allocate your own buffer, it must be exactly 522 bytes.DESCRIPTION
ThePrOpenDoc
function initializes and returns a pointer to a printing graphics port for use in printing a document. (TheTPrPort
record that defines a printing graphics port is described on page 9-48.) ThePrOpenDoc
function also sets the current graphics port to the printing graphics port.Because both the printing graphics port and input and output buffer are nonrelocatable objects, you may want to allocate them yourself using the
pPrPort
andpIOBuf
parameters (to avoid fragmenting the heap).SPECIAL CONSIDERATIONS
You must balance a call toPrOpenDoc
with a call to thePrCloseDoc
procedure, which is described in the next section.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for thePrOpenDoc
function are
Trap macro Selector _PrGlue $04000C00 SEE ALSO
For an example of the use ofPrOpenDoc
, see Listing 9-2 beginning on page 9-18. For a description of thePrValidate
function andPrintDefault
procedure, see page 9-57 and page 9-56, respectively.