Zoom to a specific rectangle.
zoomToRect2([in] int page, [in] double xMin, [in] double yMin, [in] double xMax, [in] double yMax)
This function changes the zoom factor and scroll position so that the specified rectangle just fits in the window.

The rectangle is given in PDF coordinates (not pixels). This is the same coordinate space used by getCurrentSelection2, for example.

Dim page As Long Dim x0 As Double, y0 As Double, x1 As Double, y1 As Double If viewer.getCurrentSelection2(page, x0, y0, x1, y1) Then viewer.zoomToRect2(page, x0, y0, x1, y1) End If