Class IPdfviewerController

  • public class IPdfviewerController
    extends java.lang.Object
    An IPdfviewer controller to control zoom, rotate, navigating pages and some status with the given PDF viewer instance.

    Note: this class is not thread-safe, so when it's used in multi-threading environment, the developer should handle the threading issue.

    • Method Detail

      • build

        public IPdfviewer build()
        Returns the immutable Pdfviewer instance that the controller to build with.
      • firstPage

        public void firstPage()
        Goes to the first page.
      • previousPage

        public void previousPage()
        Goes to the previous page.
      • nextPage

        public void nextPage()
        Goes to the next page.
      • lastPage

        public void lastPage()
        Goes to the last page.
      • zoomIn

        public void zoomIn()
        Zooms in by 10%.
      • zoomOut

        public void zoomOut()
        Zooms out by 10%.
      • rotateClockwise

        public void rotateClockwise()
        Rotates 90 degrees clockwise.
      • rotateCounterclockwise

        public void rotateCounterclockwise()
        Rotates 90 degrees counterclockwise.
      • getActivePage

        public int getActivePage()
        Returns the active page (starting from 0).
      • getZoom

        public double getZoom()
        Returns the zoom level.

        Default: 1.0.

      • setZoom

        public void setZoom​(double zoom)
        Sets the zoom level.
      • getRotation

        public int getRotation()
        Returns the rotation angle.

        Default: 0.

      • setRotation

        public void setRotation​(int rotation)
        Sets the rotation angle.
        rotation - rotation angle. Only 0, 90, 180 and 270 are accepted.
      • getPageCount

        public int getPageCount()
        Returns the number of pages. Note: there is at least one page even no item at all.