background image
10
December 15, 1997
X Print Service Extension Library
10
X Print Service Extension Library
Release 6.4
X Version 11
XpDestroyContext closes any outstanding associations between the print context and any display connections,
and then destroys the print context. All display connections using the print context will no longer be able to
access the print context.
Destroying a print context will cause any in-progress pages, documents and jobs to be canceled within the X
Print Server
.
XpDestroyContext can generate an XPBadContext error.
2.2.2 Obtaining the Screen for a Print Context
Use
XpGetScreenOfContext to obtain a pointer to the screen associated with the specified print context.
Screen *XpGetScreenOfContext (display, print_context)
Display *display;
XPContext print_context;
display
Specifies a pointer to the Display structure; returned from XOpenDisplay.
print_context
A pre-existing print context. This argument is currently ignored, but must be specified.
XpGetScreenOfContext returns the screen that is associated with the current print context of display. This call
must be made after
XpSetContext to determine which specific screen other X resources must be created on.
Each printer supported by a print server is associated with exactly one of the screens returned in the connec-
tion setup reply.
XpGetScreenOfContext will generate an XPBadContext error if print_context is invalid.
2.2.3 Obtaining Page Dimensions
Use
XpGetPageDimensions to get the page dimensions for the current printer settings.
Status XpGetPageDimensions (display, print_context, width, height, reproducible_area)
Display *display;
XPContext print_context;
unsigned short *width;
unsigned short *height;
XRectangle*reproducible_area;
display
Specifies a pointer to the Display structure; returned from XOpenDisplay.
print_context
A pre-existing print context.
width
Returns the pixel width of the page currently selected in the print context.
height
Returns the pixel height of the page currently selected in the print context.
reproducible_areaReturns the net reproducible area of the page currently selected in the print context,
expressed in pixel offsets and dimensions.
XpGetPageDimensions considers the medium currently selected in the print context (derived in part from
default-medium, default-input-tray, input-trays-medium, content-orientation, default-resolution), and returns
the total width and height of the page in pixels, and the net reproducible area within the total width and
height. The net reproducible area is the portion of the page on which the printer is physically capable of
placing ink.
XpGetPageDimensions returns a Status of 0 on failure, or 1 on success.
XpGetPageDimensions can generate an XPBadContext error.