Package org.zkoss.stateless.state
Class IPdfviewerController
java.lang.Object
org.zkoss.stateless.state.IPdfviewerController
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.
- Author:
- katherine
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Returns the immutable Pdfviewer instance that the controller to build with.voidGoes to the first page.intReturns the active page (starting from 0).intReturns the number of pages.intReturns 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 givenPdfviewervoidGoes to the previous page.voidRotates 90 degrees clockwise.voidRotates 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 Details
-
of
Returns the controller instance with the givenPdfviewer- Parameters:
owner- The controller to control with
-
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.WrongValueException Sets 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
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.
-