Package org.zkoss.zkex.zul
Class Pdfviewer
- java.lang.Object
-
- org.zkoss.zk.ui.AbstractComponent
-
- org.zkoss.zk.ui.HtmlBasedComponent
-
- org.zkoss.zul.impl.XulElement
-
- org.zkoss.zkex.zul.Pdfviewer
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,org.zkoss.zk.ui.Component,org.zkoss.zk.ui.ext.Scope,org.zkoss.zk.ui.sys.ComponentCtrl,org.zkoss.zul.ext.Pageable
public class Pdfviewer extends org.zkoss.zul.impl.XulElement implements org.zkoss.zul.ext.PageableA PDF file viewer.Only works for browsers supporting HTML5 (Firefox, Chrome, Opera, IE 11, Edge, Safari...).
Available in ZK PE and ZK EE.
Default
getZclass(): z-pdfviewer.- Since:
- 9.0.0
- Author:
- rudyhuang
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classPdfviewer.ExtraCtrlA utility class to implementHtmlBasedComponent.getExtraCtrl().
-
Constructor Summary
Constructors Constructor Description Pdfviewer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeChildAdded(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component insertBefore)booleanfirstPage()Go to the first page.intgetActivePage()org.zkoss.util.media.MediagetContent()Returns the content set bysetContent(org.zkoss.util.media.Media).java.lang.ObjectgetExtraCtrl()intgetPageCount()intgetPageSize()Returns the number of items per page.org.zkoss.zk.ui.sys.PropertyAccess<?>getPropertyAccess(java.lang.String prop)intgetRotation()Returns the rotation angle.java.lang.StringgetSrc()Returns the source URI of the PDF file.java.lang.StringgetZclass()doublegetZoom()Returns the zoom level.booleanlastPage()Go to the last page.booleannextPage()Go to the next page.voidonChildAdded(org.zkoss.zk.ui.Component child)voidonChildRemoved(org.zkoss.zk.ui.Component child)booleanpreviousPage()Go to the previous page.protected voidrenderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)voidrotateClockwise()Rotates 90 degrees clockwise.voidrotateCounterclockwise()Rotates 90 degrees counterclockwise.voidservice(org.zkoss.zk.au.AuRequest request, boolean everError)voidsetActivePage(int page)voidsetContent(org.zkoss.util.media.Media content)Sets the content.voidsetPageSize(int size)Sets the number of items per page.voidsetRotation(int rotation)Sets the rotation angle.voidsetSrc(java.lang.String src)Sets the source URI of the PDF file.voidsetZoom(double zoom)Sets the zoom level.voidsetZoom(java.lang.String zoom)Sets the zoom level.booleanzoomIn()Zoom in by 10%.booleanzoomOut()Zoom out by 10%.-
Methods inherited from class org.zkoss.zul.impl.XulElement
clone, getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributes
-
Methods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, evalCSSFlex, focus, getAction, getClientAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, setClientAction, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectly
-
Methods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, beforeParentChanged, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, insertBefore, invalidate, isChildable, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onPageAttached, onPageDetached, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderPropertiesOnly, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize
-
-
-
-
Method Detail
-
getSrc
public java.lang.String getSrc()
Returns the source URI of the PDF file.Default: null.
-
setSrc
public void setSrc(java.lang.String src)
Sets the source URI of the PDF file.Calling this method implies setContent(null). In other words, the last invocation of setSrc overrides the previous
setContent(org.zkoss.util.media.Media), if any.
-
getContent
public org.zkoss.util.media.Media getContent()
Returns the content set bysetContent(org.zkoss.util.media.Media).Default: null.
Note: it won't fetch what is set thru by
setSrc(java.lang.String). It simply returns what is passed tosetContent(org.zkoss.util.media.Media).
-
setContent
public void setContent(org.zkoss.util.media.Media content)
Sets the content.Calling this method implies setSrc(null). In other words, the last invocation of setContent overrides the previous
setSrc(java.lang.String), if any.
-
getActivePage
public int getActivePage()
- Specified by:
getActivePagein interfaceorg.zkoss.zul.ext.Pageable
-
setActivePage
public void setActivePage(int page) throws org.zkoss.zk.ui.WrongValueException- Specified by:
setActivePagein interfaceorg.zkoss.zul.ext.Pageable- 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(java.lang.String zoom)
Sets the zoom level.- Parameters:
zoom- fit-page-width or fit-page-height- Since:
- 9.6.0
-
getRotation
public int getRotation()
Returns the rotation angle.Default: 0.
-
setRotation
public void setRotation(int rotation)
Sets the rotation angle.- Parameters:
rotation- rotation angle. Only 0, 90, 180 and 270 are accepted.
-
renderProperties
protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) throws java.io.IOException- Overrides:
renderPropertiesin classorg.zkoss.zul.impl.XulElement- Throws:
java.io.IOException
-
getPageSize
public int getPageSize()
Returns the number of items per page.Default: 1.
- Specified by:
getPageSizein interfaceorg.zkoss.zul.ext.Pageable
-
setPageSize
public void setPageSize(int size) throws org.zkoss.zk.ui.WrongValueExceptionSets the number of items per page.It is readonly in pdfviewer.
- Specified by:
setPageSizein interfaceorg.zkoss.zul.ext.Pageable- Throws:
org.zkoss.zk.ui.WrongValueException
-
getPageCount
public int getPageCount()
- Specified by:
getPageCountin interfaceorg.zkoss.zul.ext.Pageable
-
firstPage
public boolean firstPage()
Go to the first page.- Returns:
trueif the action was successful.
-
previousPage
public boolean previousPage()
Go to the previous page.- Returns:
trueif the action was successful.
-
nextPage
public boolean nextPage()
Go to the next page.- Returns:
trueif the action was successful.
-
lastPage
public boolean lastPage()
Go to the last page.- Returns:
trueif the action was successful.
-
zoomIn
public boolean zoomIn()
Zoom in by 10%.- Returns:
trueif the action was successful.
-
zoomOut
public boolean zoomOut()
Zoom out by 10%.- Returns:
trueif the action was successful.
-
rotateClockwise
public void rotateClockwise()
Rotates 90 degrees clockwise.
-
rotateCounterclockwise
public void rotateCounterclockwise()
Rotates 90 degrees counterclockwise.
-
service
public void service(org.zkoss.zk.au.AuRequest request, boolean everError)- Specified by:
servicein interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
servicein classorg.zkoss.zk.ui.HtmlBasedComponent
-
beforeChildAdded
public void beforeChildAdded(org.zkoss.zk.ui.Component child, org.zkoss.zk.ui.Component insertBefore)- Specified by:
beforeChildAddedin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
beforeChildAddedin classorg.zkoss.zk.ui.AbstractComponent
-
onChildAdded
public void onChildAdded(org.zkoss.zk.ui.Component child)
- Specified by:
onChildAddedin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
onChildAddedin classorg.zkoss.zk.ui.AbstractComponent
-
onChildRemoved
public void onChildRemoved(org.zkoss.zk.ui.Component child)
- Specified by:
onChildRemovedin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
onChildRemovedin classorg.zkoss.zk.ui.AbstractComponent
-
getZclass
public java.lang.String getZclass()
- Overrides:
getZclassin classorg.zkoss.zk.ui.HtmlBasedComponent
-
getExtraCtrl
public java.lang.Object getExtraCtrl()
- Specified by:
getExtraCtrlin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
getExtraCtrlin classorg.zkoss.zk.ui.HtmlBasedComponent
-
getPropertyAccess
public org.zkoss.zk.ui.sys.PropertyAccess<?> getPropertyAccess(java.lang.String prop)
- Specified by:
getPropertyAccessin interfaceorg.zkoss.zk.ui.sys.ComponentCtrl- Overrides:
getPropertyAccessin classorg.zkoss.zul.impl.XulElement
-
-