public class Pdfviewer extends XulElement implements 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() . |
AbstractComponent.Children
_zclass
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE
Constructor and Description |
---|
Pdfviewer() |
Modifier and Type | Method and Description |
---|---|
void |
beforeChildAdded(Component child,
Component insertBefore)
Default: does nothing.
|
boolean |
firstPage()
Go to the first page.
|
int |
getActivePage()
Returns the active page (starting from 0).
|
Media |
getContent()
Returns the content set by
setContent(org.zkoss.util.media.Media) . |
java.lang.Object |
getExtraCtrl()
Returns the client control for this component.
|
int |
getPageCount()
Returns the number of pages.
|
int |
getPageSize()
Returns the number of items per page.
|
PropertyAccess<?> |
getPropertyAccess(java.lang.String prop)
Returns the corresponding property access object from the given property
name, if any.
|
int |
getRotation()
Returns the rotation angle.
|
java.lang.String |
getSrc()
Returns the source URI of the PDF file.
|
java.lang.String |
getZclass()
Returns the ZK Cascading Style class(es) for this component.
|
double |
getZoom()
Returns the zoom level.
|
boolean |
lastPage()
Go to the last page.
|
boolean |
nextPage()
Go to the next page.
|
void |
onChildAdded(Component child)
Default: handles special event listeners.
|
void |
onChildRemoved(Component child)
Default: handles special event listeners.
|
boolean |
previousPage()
Go to the previous page.
|
protected void |
renderProperties(ContentRenderer renderer)
Renders the content of this component, excluding the enclosing
tags and children.
|
void |
rotateClockwise()
Rotates 90 degrees clockwise.
|
void |
rotateCounterclockwise()
Rotates 90 degrees counterclockwise.
|
void |
service(AuRequest request,
boolean everError)
Processes an AU request.
|
void |
setActivePage(int page)
Sets the active page (starting from 0).
|
void |
setContent(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(java.lang.String src)
Sets the source URI of the PDF file.
|
void |
setZoom(double zoom)
Sets the zoom level.
|
void |
setZoom(java.lang.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, setTooltipAttributes
addSclass, 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, setZIndexDirectly
addAnnotation, 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, willSerialize
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
invalidatePartial
public java.lang.String getSrc()
Default: null.
public void setSrc(java.lang.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 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(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()
Pageable
getActivePage
in interface Pageable
public void setActivePage(int page) throws WrongValueException
Pageable
setActivePage
in interface Pageable
WrongValueException
public double getZoom()
Default: 1.0.
public void setZoom(double zoom)
public void setZoom(java.lang.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(ContentRenderer renderer) throws java.io.IOException
HtmlBasedComponent
renderProperties
in class XulElement
java.io.IOException
public int getPageSize()
Default: 1.
getPageSize
in interface Pageable
public void setPageSize(int size) throws WrongValueException
It is readonly in pdfviewer.
setPageSize
in interface Pageable
WrongValueException
public int getPageCount()
Pageable
getPageCount
in interface Pageable
public 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(AuRequest request, boolean everError)
HtmlBasedComponent
Default: it handles onClick, onDoubleClick, onRightClick onMove, onSize, onZIndex.
service
in interface ComponentCtrl
service
in class HtmlBasedComponent
everError
- whether any error ever occurred before
processing this request.AbstractComponent.setAuService(org.zkoss.zk.au.AuService)
public void beforeChildAdded(Component child, Component insertBefore)
AbstractComponent
beforeChildAdded
in interface ComponentCtrl
beforeChildAdded
in class AbstractComponent
child
- the child to be added (never null).insertBefore
- another child component that the new child
will be inserted before it. If null, the new child will be the
last child.ComponentCtrl.beforeChildAdded(org.zkoss.zk.ui.Component, org.zkoss.zk.ui.Component)
public void onChildAdded(Component child)
AbstractComponent
onChildAdded
in interface ComponentCtrl
onChildAdded
in class AbstractComponent
ComponentCtrl.onChildAdded(org.zkoss.zk.ui.Component)
public void onChildRemoved(Component child)
AbstractComponent
onChildRemoved
in interface ComponentCtrl
onChildRemoved
in class AbstractComponent
ComponentCtrl.onChildRemoved(org.zkoss.zk.ui.Component)
public java.lang.String getZclass()
HtmlBasedComponent
AbstractComponent.getMold()
).
Default: null (the default value depends on element).
HtmlBasedComponent.setZclass(java.lang.String)
) will completely replace the default style
of a component. In other words, the default style of a component
is associated with the default value of HtmlBasedComponent.getZclass()
.
Once it is changed, the default style won't be applied at all.
If you want to perform small adjustments, use HtmlBasedComponent.setSclass(java.lang.String)
instead.
getZclass
in class HtmlBasedComponent
HtmlBasedComponent.getSclass()
public java.lang.Object getExtraCtrl()
HtmlBasedComponent
Default: creates an instance of HtmlBasedComponent.ExtraCtrl
.
getExtraCtrl
in interface ComponentCtrl
getExtraCtrl
in class HtmlBasedComponent
Cropper
.ComponentCtrl.getExtraCtrl()
public PropertyAccess<?> getPropertyAccess(java.lang.String prop)
ComponentCtrl
getPropertyAccess
in interface ComponentCtrl
getPropertyAccess
in class XulElement
prop
- the name of the propertyCopyright © 2005-2023 Potix Corporation. All Rights Reserved.