View mode

There are a few view modes which can be adjusted to provide an optimal presentation such as layout, fit, or reflow. Additionally, you can present a view mode dialog allowing a user to change these settings.

Page fit & default zoom mode in Android

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 configured PDFViewCtrl by using AppUtils.setupPDFViewCtrl, the page view mode and zoom level is maintained automatically. Click here to learn more about setting up PDFViewCtrl.

Page view modes

PDFViewCtrl supports the following page view modes:

Page view mode

Description

Screenshot-portrait

Screenshot-landscape

PageViewMode.FIT_PAGE

The zoom is set so that the entire page is visible without scrolling.

Apryse Docs Image
Apryse Docs Image

PageViewMode.FIT_WIDTH

The zoom is set so that the page's width matches the viewer's width.

Apryse Docs Image
Apryse Docs Image

PageViewMode.FIT_HEIGHT

The zoom is set so that the page's height matches the viewer's height.

Apryse Docs Image
Apryse Docs Image

PageViewMode.ZOOM

The viewer's zoom is not adjusted based on the page.

Apryse Docs Image
Apryse Docs Image

Set the default page fit mode

You can set a default page fit mode in your PDFViewCtrl by using setPageRefViewMode(PageViewMode).

Set the page fit mode dynamically

If you want to dynamically change the page fit mode, use setPageViewMode(PageViewMode). Note that when the user flips the page, the page view mode will be automatically reset to the default mode set by setPageRefViewMode.

1mPdfViewCtrl.setPageViewMode(PDFViewCtrl.PageViewMode.FIT_WIDTH);

It is also possible to maintain the zoom level when switching pages.

PDFViewCtrl allows users to zoom in and out with touch gestures. To maintain zoom level when flipping pages, call setMaintainZoomEnabled(boolean). Note that 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).

1private PDFViewCtrl mPdfViewCtrl;
2// ...
3private void zoomSettingSample() throws PDFNetException {
4 // Enable maintain zoom level
5 mPdfViewCtrl.setMaintainZoomEnabled(true);
6 // Set preferred view mode to PageViewMode.FIT_PAGE
7 mPdfViewCtrl.setPreferredViewMode(PDFViewCtrl.PageViewMode.FIT_PAGE);
8 // Set PageViewMode.FIT_PAGE to current page view mode
9 mPdfViewCtrl.setPageViewMode(PDFViewCtrl.PageViewMode.FIT_PAGE);
10}

Did you find this helpful?

Trial setup questions?

Ask experts on Discord

Need other help?

Contact Support

Pricing or product questions?

Contact Sales