Important: The information in this document is obsolete and should not be used for new development.
PrOpenDoc
Use thePrOpenDocfunction 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
TPrintrecord (described on page 9-41), which may be a new record or an existing one from a document. You should call thePrintDefaultprocedure (described on page 9-56) or thePrValidatefunction (described on page 9-57) for thisTPrintrecord before callingPrOpenDoc.pPrPort- A pointer to a printing graphics port. If you set this parameter to
NIL,PrOpenDocallocates 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,PrOpenDocuses the volume buffer for the deferred spool file's volume. If you allocate your own buffer, it must be exactly 522 bytes.DESCRIPTION
ThePrOpenDocfunction initializes and returns a pointer to a printing graphics port for use in printing a document. (TheTPrPortrecord that defines a printing graphics port is described on page 9-48.) ThePrOpenDocfunction 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
pPrPortandpIOBufparameters (to avoid fragmenting the heap).SPECIAL CONSIDERATIONS
You must balance a call toPrOpenDocwith a call to thePrCloseDocprocedure, which is described in the next section.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for thePrOpenDocfunction 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 thePrValidatefunction andPrintDefaultprocedure, see page 9-57 and page 9-56, respectively.