public class Pdfviewer
extends org.zkoss.zul.impl.XulElement
implements org.zkoss.zul.ext.Pageable
Only works for browsers supporting HTML5 (Firefox, Chrome, Opera, IE 11, Edge, Safari...).
Available in ZK PE and ZK EE.
Default getZclass(): z-pdfviewer.
| Modifier and Type | Class and Description |
|---|---|
protected class |
Pdfviewer.ExtraCtrl
A utility class to implement
HtmlBasedComponent.getExtraCtrl(). |
| Constructor and Description |
|---|
Pdfviewer() |
| Modifier and Type | Method and Description |
|---|---|
void |
beforeChildAdded(org.zkoss.zk.ui.Component child,
org.zkoss.zk.ui.Component insertBefore) |
boolean |
firstPage()
Go to the first page.
|
int |
getActivePage() |
org.zkoss.util.media.Media |
getContent()
Returns the content set by
setContent(org.zkoss.util.media.Media). |
Object |
getExtraCtrl() |
int |
getPageCount() |
int |
getPageSize()
Returns the number of items per page.
|
org.zkoss.zk.ui.sys.PropertyAccess<?> |
getPropertyAccess(String prop) |
int |
getRotation()
Returns the rotation angle.
|
String |
getSrc()
Returns the source URI of the PDF file.
|
String |
getZclass() |
double |
getZoom()
Returns the zoom level.
|
boolean |
lastPage()
Go to the last page.
|
boolean |
nextPage()
Go to the next page.
|
void |
onChildAdded(org.zkoss.zk.ui.Component child) |
void |
onChildRemoved(org.zkoss.zk.ui.Component child) |
boolean |
previousPage()
Go to the previous page.
|
protected void |
renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer) |
void |
rotateClockwise()
Rotates 90 degrees clockwise.
|
void |
rotateCounterclockwise()
Rotates 90 degrees counterclockwise.
|
void |
service(org.zkoss.zk.au.AuRequest request,
boolean everError) |
void |
setActivePage(int page) |
void |
setContent(org.zkoss.util.media.Media content)
Sets the content.
|
void |
setPageSize(int size)
Sets the number of items per page.
|
void |
setRotation(int rotation)
Sets the rotation angle.
|
void |
setSrc(String src)
Sets the source URI of the PDF file.
|
void |
setZoom(double zoom)
Sets the zoom level.
|
void |
setZoom(String zoom)
Sets the zoom level.
|
boolean |
zoomIn()
Zoom in by 10%.
|
boolean |
zoomOut()
Zoom out by 10%.
|
clone, getContext, getCtrlKeys, getPopup, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributesaddSclass, evalCSSFlex, focus, getAction, getDraggable, getDroppable, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZindex, getZIndex, removeSclass, removeSclass, setAction, setClass, 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, setZIndexDirectlyaddAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, 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, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidate, invalidatePartial, isChildable, isInitialized, isInvalidated, isListenerAvailable, isVisible, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, 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, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerializepublic String getSrc()
Default: null.
public void setSrc(String src)
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.
public org.zkoss.util.media.Media getContent()
setContent(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 to setContent(org.zkoss.util.media.Media).
public void setContent(org.zkoss.util.media.Media content)
Calling this method implies setSrc(null).
In other words, the last invocation of setContent overrides
the previous setSrc(java.lang.String), if any.
public int getActivePage()
getActivePage in interface org.zkoss.zul.ext.Pageablepublic void setActivePage(int page)
throws org.zkoss.zk.ui.WrongValueException
setActivePage in interface org.zkoss.zul.ext.Pageableorg.zkoss.zk.ui.WrongValueExceptionpublic double getZoom()
Default: 1.0.
public void setZoom(double zoom)
public void setZoom(String zoom)
zoom - fit-page-width or fit-page-heightpublic int getRotation()
Default: 0.
public void setRotation(int rotation)
rotation - rotation angle. Only 0, 90, 180 and 270 are accepted.protected void renderProperties(org.zkoss.zk.ui.sys.ContentRenderer renderer)
throws IOException
renderProperties in class org.zkoss.zul.impl.XulElementIOExceptionpublic int getPageSize()
Default: 1.
getPageSize in interface org.zkoss.zul.ext.Pageablepublic void setPageSize(int size)
throws org.zkoss.zk.ui.WrongValueException
It is readonly in pdfviewer.
setPageSize in interface org.zkoss.zul.ext.Pageableorg.zkoss.zk.ui.WrongValueExceptionpublic int getPageCount()
getPageCount in interface org.zkoss.zul.ext.Pageablepublic boolean firstPage()
true if the action was successful.public boolean previousPage()
true if the action was successful.public boolean nextPage()
true if the action was successful.public boolean lastPage()
true if the action was successful.public boolean zoomIn()
true if the action was successful.public boolean zoomOut()
true if the action was successful.public void rotateClockwise()
public void rotateCounterclockwise()
public void service(org.zkoss.zk.au.AuRequest request,
boolean everError)
service in interface org.zkoss.zk.ui.sys.ComponentCtrlservice in class org.zkoss.zk.ui.HtmlBasedComponentpublic void beforeChildAdded(org.zkoss.zk.ui.Component child,
org.zkoss.zk.ui.Component insertBefore)
beforeChildAdded in interface org.zkoss.zk.ui.sys.ComponentCtrlbeforeChildAdded in class org.zkoss.zk.ui.AbstractComponentpublic void onChildAdded(org.zkoss.zk.ui.Component child)
onChildAdded in interface org.zkoss.zk.ui.sys.ComponentCtrlonChildAdded in class org.zkoss.zk.ui.AbstractComponentpublic void onChildRemoved(org.zkoss.zk.ui.Component child)
onChildRemoved in interface org.zkoss.zk.ui.sys.ComponentCtrlonChildRemoved in class org.zkoss.zk.ui.AbstractComponentpublic String getZclass()
getZclass in class org.zkoss.zk.ui.HtmlBasedComponentpublic Object getExtraCtrl()
getExtraCtrl in interface org.zkoss.zk.ui.sys.ComponentCtrlgetExtraCtrl in class org.zkoss.zk.ui.HtmlBasedComponentpublic org.zkoss.zk.ui.sys.PropertyAccess<?> getPropertyAccess(String prop)
getPropertyAccess in interface org.zkoss.zk.ui.sys.ComponentCtrlgetPropertyAccess in class org.zkoss.zul.impl.XulElementCopyright © 2026. All rights reserved.