PDFViewCtrl page view mode

In this document
chevron_rightPage view modes

PDFViewCtrl's page view mode controls the default zoom level of pages and documents. New documents will automatically open at the zoom level specified by the mode.

If you configure PDFViewCtrl by AppUtils.setupPDFViewCtrl(PDFViewCtrl, PDFViewCtrlConfig), it will set up page view mode and maintain zoom level automatically. To learn more about setup PDFViewCtrl, see using PDFViewCtrl.

Page view modes

PDFViewCtrl supports the following page view modes:

Page view modeDescriptionScreenshot-portraitScreenshot-landscape
PageViewMode.FIT_PAGEZoom is automatically adjusted so that the entire page fits into available space.
PageViewMode.FIT_WIDTHZoom is automatically adjusted so that the page width fits into available space.
PageViewMode.FIT_HEIGHTZoom is automatically adjusted so that the page height fits into available space.
PageViewMode.ZOOMPage is zoomed based on the factor specified using setZoom(double) and its variants.

Initializing page view mode

To initialize page view mode, call setPageRefViewMode(PageViewMode).

pdfViewCtrl.setPageRefViewMode(PageViewMode.FIT_PAGE);

where pdfViewCtrl is an instance of PDFViewCtrl.

Setting page view mode

To change page view mode, call setPageViewMode(PageViewMode). Please note when you flip pages, the PDFViewCtrl will reset the page view mode from setPageRefViewMode(PageViewMode).

pdfViewCtrl.setPageViewMode(PageViewMode.FIT_PAGE);

where pdfViewCtrl is an instance of PDFViewCtrl.

Maintaining zoom level

PDFViewCtrl allows users to zoom in/out with finger gestures. To maintain zoom level when flipping pages, call setMaintainZoomEnabled(boolean). Please note when you double tap PDFViewCtrl will end zooming and reset the page view mode to preferred page view mode. To set preferred page view mode, callsetPreferredViewMode(PageViewMode).

// enable maintain zoom level
pdfViewCtrl.setMaintainZoomEnabled(true);
// set preferred view mode to PageViewMode.FIT_PAGE
pdfViewCtrl.setPreferredViewMode(PageViewMode.FIT_PAGE);
// set PageViewMode.FIT_PAGE to current page view mode
pdfViewCtrl.setPageViewMode(PageViewMode.FIT_PAGE);

where pdfViewCtrl is an instance of PDFViewCtrl.