Package org.zkoss.stateless.state
Class IPdfviewerController
- java.lang.Object
-
- org.zkoss.stateless.state.IPdfviewerController
-
public class IPdfviewerController extends java.lang.ObjectAnIPdfviewercontroller 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.
- Author:
- katherine
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IPdfviewerbuild()Returns the immutable Pdfviewer instance that the controller to build with.voidfirstPage()Goes to the first page.intgetActivePage()Returns the active page (starting from 0).intgetPageCount()Returns the number of pages.intgetRotation()Returns the rotation angle.doublegetZoom()Returns the zoom level.voidlastPage()Goes to the last page.voidnextPage()Goes to the next page.static IPdfviewerControllerof(IPdfviewer owner)Returns the controller instance with the givenPdfviewervoidpreviousPage()Goes to the previous page.voidrotateClockwise()Rotates 90 degrees clockwise.voidrotateCounterclockwise()Rotates 90 degrees counterclockwise.voidsetActivePage(int page)Sets the active page (starting from 0).voidsetRotation(int rotation)Sets the rotation angle.voidsetZoom(double zoom)Sets the zoom level.voidsetZoom(IPdfviewer.ZoomMode zoomMode)Sets the zoom level.voidzoomIn()Zooms in by 10%.voidzoomOut()Zooms out by 10%.
-
-
-
Method Detail
-
of
public static IPdfviewerController of(IPdfviewer owner)
Returns the controller instance with the givenPdfviewer- Parameters:
owner- The controller to control with
-
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).
-
setActivePage
public void setActivePage(int page) throws org.zkoss.zk.ui.WrongValueExceptionSets the active page (starting from 0).- Throws:
org.zkoss.zk.ui.WrongValueException
-
getZoom
public double getZoom()
Returns the zoom level.Default:
1.0.
-
setZoom
public void setZoom(double zoom)
Sets the zoom level.
-
setZoom
public void setZoom(IPdfviewer.ZoomMode zoomMode)
Sets the zoom level.- Parameters:
zoomMode-IPdfviewer.ZoomMode.FIT_PAGE_HEIGHTorIPdfviewer.ZoomMode.FIT_PAGE_WIDTH
-
getRotation
public int getRotation()
Returns the rotation angle.Default:
0.
-
setRotation
public void setRotation(int rotation)
Sets the rotation angle.- Parameters:
rotation- rotation angle. Only0,90,180and270are accepted.
-
getPageCount
public int getPageCount()
Returns the number of pages. Note: there is at least one page even no item at all.
-
-