ViewGetMetrics Method

Build 1501 on 14/Nov/2017  This topic last edited on: 23/Mar/2016, at 12:16

Description

Returns document window specific data:

X position of page upper left corner (MPt)

Y position of page upper left corner (MPt)

Pasteboard horizontal size on one side of the page (MPt)

Pasteboard vertcal size on one side of the page (MPt)

Page window width (pixel)

Page window height (pixel)

How many MPt in each pixel, at current zoom level

Syntax

Page.ViewGetMetrics (index)

Index

0 = X position of page upper left corner (MPt)

1 = Y position of page upper left corner (MPt)

2 = Pasteboard horizontal size on one side of the page (MPt)

3 = Pasteboard vertcal size on one side of the page (MPt)

4 = Page window width (pixel)

5 = Page window height (pixel)

6 = How many MPt in each pixel, at current zoom level

Remarks

Returns error code.

Examples

To maintain left offset of the page in window when fitting to page:

x1= Page.ViewGetMetrics(0)

Page.ViewZoomFit

Page.ViewPositionAt (x1, Page.ViewGetMetrics(1), False)

To shift page right by 10pt (useful to scroll page in all directions by a determinate step):

Page.ViewPositionAt (Page.ViewGetMetrics(0) + 10000, Page.ViewGetMetrics(1), false)

To display the pasteboard size and visible height

MsgBox ("Full Pasteboard width " & Page.ViewGetMetrics(2)*2+Page.GetPageWidth())

MsgBox ("Window visible height (MPt) " & Page.ViewGetMetrics(5)*Page.ViewGetMetrics(6))

Context

Page designer

See also

ViewPositionAt