Method XbpPrinter():create() Foundation

Requests system resources for the printer device context.

:create( [<cDeviceName>], [<nSpoolFormat>|<cSpoolFormat>], ;
                          [<cDeviceParams>] ) --> self
When several printer objects are installed, the name of the printer object for which a device context is created can be explicitly specified using <cDeviceName>. <cDeviceName> must be a character string that exactly matches the name of the desired printer object. The name of the printer object is displayed below the symbol for the printer. If <cDeviceName> is not specified or the name does not match any installed printer object, a device context is created for the default printer. The default printer is set on the desktop using the context menu of the printer object. A list of the available printer object names can be determined using the method :list(). This method can be executed before :create() is called.
The optional parameter <nSpoolFormat> specifies the format used to spool print jobs. If <nSpoolFormat> is specified, it must be set to a numeric value identifying one of the default spool formats (PRN_Q_xxx constants) defined in the file XBPDEV.CH.
For printers supporting non-standard spool formats, the desired spool format can also be specified using the <cSpoolFormat> parameter. In this case, a character string with the name of the format must be assigned to the parameter.
The spool format should not be changed unless the application has specific printing requirements. For example, if the application sends native printer commands to the printer, the spool format may have to adjusted in order to prevent the driver from transforming the output stream. :spoolFormat instance variable for further information.
The optional parameter :devParams specifies a character string that provides additional parameters for special printer drivers. These parameters are device dependent and must be documented with the printer driver. As an example, the driver for a fax printer might need information about the telephone number in order to send the print job as a fax.
<nDeviceParams> is ignored under Windows.

This method returns the object executing the method (self).


An XbpPrinter object manages a device context provided by the operating system. After XpbPrinter():new() is called, the XbpPrinter object exists but its device context does not yet exist. The :create() method requests the device context from the operating system. Graphic output can be sent from a presentation space to the XbpPrinter object and its device context only after the :create() method is called.


If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.