From Xojo Documentation

Revision as of 19:41, 2 August 2017 by PLefebvre (talk | contribs)

Read-Only Property (As Integer )
IntegerValue = aPrinterSetup.Width

Supported for all project types and targets.

The width of the printable area on the page in pixels. The width is the PageWidth minus the margins.


This example displays the Page Setup box and then displays the page size, printable area, and margins in Label controls. Results, of course, depend on the page size that the user selects. Since PageLeft and PageTop are the horizontal and vertical margins as measured from the printable area rather than the edge of the page, they are negative.

Dim settings As String
Dim p As New PrinterSetup
If p.PageSetupDialog Then
settings = p.SetupString
End If

Label1.Text = "PageLeft=" + Str(p.PageLeft)
Label2.Text = "PageTop=" + Str(p.PageTop)
Label3.Text = "PageHeight=" + Str(p.PageHeight)
Label4.Text = "PageWidth=" + Str(p.PageWidth)
Label5.Text = "Height=" + Str(p.Height)
Label6.Text = "Width=" + Str(p.Width)
Label7.Text = "Computed height=" + Str(p.Height - 2 * p.PageTop)
Label8.Text = "Computed width=" + Str(p.Width - 2 * p.PageLeft)
Label9.Text = "Horizontal resolution=" + Str(p.HorizontalResolution)
Label10.Text = "Vertical Resolution=" + Str(p.VerticalResolution)