Method XbpPrinter():paperSize() Foundation

Returns the paper size in 1/10 millimeters.

:paperSize() --> aPaperSize

This method returns an eight element array containing the paper size of the printer object plus information about margins that cannot be printed on.

Array elements of :paperSize()
Element Meaning
1 Paper width in 1/10 mm (= nXsize)
2 Paper height in 1/10 mm (= nYsize)
3 Left margin in 1/10 mm (= nLeftMargin)
4 Bottom margin in 1/10 mm (= nBottomMargin)
5 Right margin in 1/10 mm (= nRightMargin)
6 Top margin in 1/10 mm (= nTopMargin)
7 Width in pixel
8 Height in pixel

Values for not printable margins refer to the lower left corner of a paper. For the paper size A4 (2100, 2970) the margins could have the following coordinates: 50, 50, 2050, 2920. In this case a margin of 5 mm exists on all four sides of a paper that cannot be used for printed output.


The method :paperSize() returns the paper size set for the printer object. The paper size is set using an OS/2 dialog window that is either called through the printer object notebook (printer driver->job attributes) or using the method :setupDialog(). The paper size is always set in 1/10 millimeters, regardless of whether the paper size being set is a standard American size (such as letter or legal) or a European size (such as A4).

Many laser printers define margins on a paper that cannot be printed on. The width of these margins is contained in array elements 2 to 6 and they must be considered for printing. The available coordinate system for printing is not defined by the lower left corner of the paper but starts at the point defined by the left and bottom margin of the printer (hardware dependent). The same is true for the size of the printer coordinate system. It does not end at the upper right corner of the paper but is limited by the right and top margins.

The last two array elements contain the paper size in pixel units. These values are used to convert printer coordinates to screen coordinates. This is necessary, for example, when a preview window is programmed to display the output WYSIWYG on screen before it is sent to the printer (WYSIWYG = What You See Is What You Get).


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.