[PDFNet] [Android] How to set the minimum and maximum zoom of PDFViewCtrl

Q: I . How to set the minimum zoom, so that the page cannot be zoomed out more than the size of the device?

A:  The easiest way is to use PDFViewCtrl.setZoomLimits(int zoom_limit_mode, double min_zoom, double max_zoom).  Online documentation can be found from [http://www.pdftron.com/pdfnet/mobile/Javadoc/index.html](http://www.pdftron.com/pdfnet/mobile/Javadoc/index.html) and the following is the excerpt:


zoom_limit_mode - defines how the minimum and maximum zoom bounds are used. Possible values are:

· ZOOM_LIMIT_ABSOLUTE: bounds are in absolute sense.

· ZOOM_LIMIT_RELATIVE: bounds are in relative sense.

· ZOOM_LIMIT_NONE: zoom bounds are not used, default value.

min_zoom - the minimum zoom bound.

max_zoom - the maximum zoom bound.


If ZOOM_LIMIT_RELATIVE is used, min_zoom and max_zoom are relative to the zoom level when the current page is displayed in PAGE_VIEW_FIT_PAGE mode. For instance, if min_zoom = 1.0 and max_zoom = 3, it means that the minimum zoom allowed by PDFViewCtrl is the same as the zoom when a page is fit and the maximum zoom allowed is three times that when the page is fit.

Another possibility is to use PDFViewCtrl.Tool interface to implement necessary functions to constraint how much PDFViewCtrl can zoom based on the current document.