Method XbpPresSpace():setPageSize() Foundation

Sets or returns the page size in the presentation space.

:setPageSize([<aPageSize>], [<nUnits>]) --> aOldSettings
<aPageSize> := { nXsize, nYsize }
The <aPageSize> parameter determines the page size in the presentation space. This parameter must be an array containing two elements that specify the dimensions of the page in the x and y directions (X = width, Y = height). The page size also depends on the coordinate system units <nUnits>. The origin of the coordinate system (the point {0,0}) is the lower left corner of the page.
The parameter <nUnits> optionally specifies the units for the coordinate system of the presentation space. The default units are pixels. To define another unit, #define constants must be specified for <nUnits>. The following table lists all of the constants that can be used for <nUnits>.
Constants for the unit of the coordinate system
Constant Description
GRA_PU_ARBITRARY Any unit. The coordinate system is scaled to the viewport.
GRA_PU_PIXEL *) Units are a pixel
GRA_PU_LOMETRIC Units are 0.1 millimeter
GRA_PU_HIMETRIC Units are 0.01 millimeter
GRA_PU_LOENGLISH Units are 0.1 inch
GRA_PU_HIENGLISH Units are 0.01 inch
GRA_PU_TWIPS Units are 1/1440 inch
  1. Default value

The :setPageSize() method returns an array of two elements. The first element of the array is a subarray containing the current page size and the second element is a numeric value identifying the coordinate system units {aOldPageSize, nOldUnits}.


The :setPageSize() method determines the page size and the coordinate system units for the presentation space. The page size and units determine the scale for the output of graphic functions. The output of graphic functions occurs in the presentation space. This means that the coordinates passed to graphic functions such as GraArc(), GraBox() or GraStringAt() are relative to the coordinate system and units of the page in the presentation space.

Raster images (bitmaps) are an exception. Bitmaps are only displayed in the unit "pixels". If the page of a presentation space is changed, bitmaps must be separately scaled if appropriate. The function GraBitBlt() is used to scale bitmaps.

When a new page size is defined, most of the data stored in the presentation space object is reset and replaced with default values. Previously defined settings are discarded:

All attributes for graphic primitives are set to their default values, open graphic segments and paths are discarded, existing segments are deleted, the pen position is set to {0,0}, and the view port and draw mode is reset.


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.