How do I keep 'Fit Page Width' or zoom mode as I flip through PDF?

Q:

When we use a tablet in the landscape mode, we want to fill the page with the PDF. The PDF has to be shown filling the full width of the tablet.

We have used pdfviewctrl.setPageViewMode with the param PAGE_VIEW_FIT_WIDTH

The problem is that when we pass from one page to the next one, the page is showed complete, in the middle of the screen.

We would like that when the user flips from one page to another, all the pages are shown filling the full width of the screen.

Additionally, when we show the page in portrait mode, we also want the page to be placed at the top of the screen, not in the middle. How can we do that?

A:

To keep the page in “fit width” mode when changing pages, you can use the PDFViewCtrl.setPageRefViewMode(). This method was added in recent builds so make sure that you are using the latest SDK. Then, you would call:

pdfViewCtrl.setPageViewMode(PDFViewCtrl.PAGE_VIEW_FIT_WIDTH);

pdfViewCtrl.setPageRefViewMode(PDFViewCtrl.PAGE_VIEW_FIT_WIDTH);

Regarding the placement of the page at the top of the screen, you could use pdfviewctrl.SetVerticalAlign(-1)
For horizontal alignment use pdfviewctrl.SetHorizontalAlign(mode)…