GEOS SDK TechDocs
|
|
4.3 Page Range Information
|
4.5 Print Output Object
PCI_docSizeInfo, MSG_PRINT_CONTROL_SET_DOC_SIZE, MSG_PRINT_CONTROL_GET_DOC_SIZE, MSG_PRINT_CONTROL_SET_DOC_MARGINS, MSG_PRINT_CONTROL_GET_DOC_MARGINS, MSG_PRINT_CONTROL_SET_EXTENDED_DOC_SIZE, MSG_PRINT_CONTROL_GET_EXTENDED_DOC_SIZE, MSG_PRINT_CONTROL_SET_DOC_SIZE_INFO, MSG_PRINT_CONTROL_GET_DOC_SIZE_INFO
It is possible to specify the size of the document when creating the Print Control. Note that this is the size of the document, not the size of the piece of paper. Ideally, the document should fit on the paper, though obviously in the case of huge documents like some spreadsheets, this may not be the case. The document size includes the margin size; it is possible to set the margin size as well.
The document size must be set correctly before the document is finished printing. If all documents the application produces have the same dimensions (or if you want some size to be the default), you may specify dimensions for the document when instantiating the print control. You may also set up document margins at this time.
The messages listed above get and set the document and margin sizes. You must use
MSG_PRINT_CONTROL_GET_EXTENDED_DOC_SIZE
and
MSG_PRINT_CONTROL_SET_EXTENDED_DOC_SIZE
when working with the dimensions of 32-bit extended documents.
void MSG_PRINT_CONTROL_SET_DOC_SIZE(
int width,
int height);
This message changes the values of the document size. It takes two integers, representing the new width and height for the document to use. It can only use 16-bit values, so use
MSG_PRINT_CONTROL_SET_EXTENDED_DOC_SIZE
when working with 32-bit extended graphics spaces.
Remember that the document size includes the document margins.
Source: Unrestricted.
Destination: Any PrintControl object.
Parameters:
width
The document's width, in points.
Return: Nothing.
Interception: Unlikely.
dword MSG_PRINT_CONTROL_GET_DOC_SIZE();
Use this message to retrieve the present document size. The size is returned as a width and height, each expressed in points.
Note that if the size might be a 32-bit value (which might happen if the document uses an extended graphics space), you must use the
MSG_PRINT_CONTROL_GET_EXTENDED_DOC_SIZE
. If either dimension is a 32-bit number, using a regular
MSG_PRINT_CONTROL_GET_DOC_SIZE
will result in an error.
Remember that the document size includes the document margins.
Source: Unrestricted.
Destination: Any PrintControl object.
Parameters: None.
Return: A double word. The high word is the width, the low word is the height.
Interception: Unlikely.
void MSG_PRINT_CONTROL_SET_EXTENDED_DOC_SIZE(
PCDocSizeParams *ptr);
This message changes the values of the document size using the two passed double integers as the new width and height to use. When working with normal 16 bit graphics spaces, use
MSG_PRINT_CONTROL_SET_DOC_SIZE
instead.
Remember that the document size includes the document margins.
Source: Unrestricted.
Destination: Any PrintControl object.
Parameters: ptr Pointer to a
PCDocSizeParams
structure containing the document size.
Return: Nothing.
Interception: Unlikely.
Structures:
The
PCDocSizeParams
structure has the following definition:
typedef struct {
dword PCDSP_width;
dword PCDSP_height;
} PCDocSizeParams;
void MSG_PRINT_CONTROL_GET_EXTENDED_DOC_SIZE(
PCDocSizeParams *ptr);
Use this message to retrieve the present document size. It returns two double integers representing the width and height, expressed in points. If the size is a 16 bit value, you can use
MSG_PRINT_CONTROL_GET_DOC_SIZE
instead.
Remember that the document size includes the document margins.
Source: Unrestricted.
Destination: Any PrintControl object.
Parameters: ptr Pointer to a
PCDocSizeParams
structure to hold document parameters.
Return: Nothing is returned explicitly.
Interception: Unlikely.
Structures: The
PCDocSizeParams
structure has the following definition:
typedef struct {
dword PCDSP_width;
dword PCDSP_height;
} PCDocSizeParams;
void MSG_PRINT_CONTROL_SET_DOC_MARGINS(
PCMarginParams *ptr);
Use this message to set new values for the document margins. It takes four arguments, the point values to use for the left, top, right, and bottom margins.
Source: Unrestricted.
Destination: Any PrintControl object.
Parameters: ptr Pointer to a
PCMarginParams
structure with new document margins.
Return: Nothing.
Interception: Unlikely.
Structures: The
PCMarginParams
structure has the following definition:
typedef struct {
word PCMP_left;
word PCMP_top;
word PCMP_right;
word PCMP_bottom;
} PCMarginParams;
void MSG_PRINT_CONTROL_GET_DOC_MARGINS(
PCMarginParams *ptr);
Use this message to get the present values for the document margins. It returns four integers. These integers represent the left, top, right, and bottom margins, expressed in typographer's points.
Source: Unrestricted.
Destination: Any PrintControl object.
Parameters: ptr Pointer to a
PCMarginParams
structure which will hold return value.
Return: Nothing returned explicitly.
Interception: Unlikely.
Structures: The
PCMarginParams
structure has the following definition:
typedef struct {
word PCMP_left;
word PCMP_top;
word PCMP_right;
word PCMP_bottom;
} PCMarginParams;
void MSG_PRINT_CONTROL_SET_DOC_SIZE_INFO(
PageSizeReport *ptr);
Use this message to set all of the information about the document size and orientation.
Source: Unrestricted.
Destination: Any PrintControl object.
Parameters: ptr Pointer to a
PageSizeReport
structure.
Return: Nothing.
Interception: Unlikely.
Structures: The
PageSizeReport
structure has the following definition:
typedef struct {
dword PSR_width;
dword PSR_height;
PageLayout PSR_layout;
PCMarginParams PSR_margins;
} PageSizeReport;
void MSG_PRINT_CONTROL_GET_DOC_SIZE_INFO(
PageSizeReport *ptr);
Use this message to set all of the information about the document size and orientation.
Source: Unrestricted.
Destination: Any PrintControl object.
Parameters: ptr Pointer to an empty
PageSizeReport
structure which the message handler will fill in.
Return: Nothing.
Interception: Unlikely.
Structures: The
PageSizeReport
structure has the following definition:
typedef struct {
dword PSR_width;
dword PSR_height;
PageLayout PSR_layout;
PCMarginParams PSR_margins;
} PageSizeReport;
GEOS SDK TechDocs
|
|
4.3 Page Range Information
|
4.5 Print Output Object