The Spool Library: 4.4 Print Control Instance Data: Document Size

Up: GEOS SDK TechDocs | Up | Prev: 4.3 Page Range Information | Next: 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.

MSG_PRINT_CONTROL_SET_DOC_SIZE

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.

height
The document's height, in points.

Return: Nothing.

Interception: Unlikely.

MSG_PRINT_CONTROL_GET_DOC_SIZE

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.

MSG_PRINT_CONTROL_SET_EXTENDED_DOC_SIZE

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;

MSG_PRINT_CONTROL_GET_EXTENDED_DOC_SIZE

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.

ptr
The structure is filled with document size.

Interception: Unlikely.

Structures: The PCDocSizeParams structure has the following definition:

typedef struct {
	dword		PCDSP_width;
	dword		PCDSP_height;
} PCDocSizeParams;

MSG_PRINT_CONTROL_SET_DOC_MARGINS

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;

MSG_PRINT_CONTROL_GET_DOC_MARGINS

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.

ptr
Structure filled in with document margins.

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;

MSG_PRINT_CONTROL_SET_DOC_SIZE_INFO

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;

MSG_PRINT_CONTROL_GET_DOC_SIZE_INFO

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;

Up: GEOS SDK TechDocs | Up | Prev: 4.3 Page Range Information | Next: 4.5 Print Output Object