public interface IViewer
Modifier and Type | Method and Description |
---|---|
void |
addViewerListener(DocumentViewerListener viewerListener)
Adds specified user-class instance to the list of listeners that are
notified about viewer events.
|
void |
closeDocument()
Stops the display of the documents and unloads it from memory.
|
void |
dispose() |
void |
firstPage()
Navigates to the first page.
|
IDocument |
getActiveDocument()
Returns the active document.
|
int |
getBorderWidth()
Returns width of the border of the viewer.
|
Component |
getComponent()
Returns the container component.
|
int |
getCurrentPageNumber()
Returns current page number.
|
double |
getMaxZoomVal()
Returns page magnification that can be used to display documents.
|
double |
getMinZoomVal()
Returns minimum page magnification that can be used to display documents.
|
int |
getPageCount()
Returns number of pages in the document.
|
PageLayout |
getPageLayout()
Returns current page layout setting.
|
double[] |
getPredefinedZoomValues()
|
ViewerPreferences |
getPreferences()
Returns viewer settings.
|
RotationAngle |
getRotationAngle()
Returns current angle of rotation.
|
List<String> |
getSupportedFormats()
Returns the list of supported formats.
|
DocumentViewerListener[] |
getViewerListeners()
Returns list of user-class instance that are notified of viewer events.
|
int[] |
getVisiblePageNumbers()
Returns numbers of pages that are current displayed.
|
Zoom |
getZoom()
Returns current page magnification.
|
void |
goToPageNumber(int pageNum)
Navigates to specified page.
|
boolean |
isDocumentLoaded()
Returns whether a document has been loaded in the viewer.
|
void |
lastPage()
Navigates to the last page.
|
void |
loadDocument(InputStream inputStream,
String password)
Loads a document from specified stream with specified stream.
|
void |
loadDocument(String fileName,
String password)
Loads specified document with specified password.
|
int |
nextPage()
Navigates to the next page.
|
int |
previousPage()
Navigates to the previous page.
|
void |
refresh()
Refreshes the display.
|
void |
removeViewerListener(DocumentViewerListener viewerListener)
Removes specified user-class instance from the list of listeners that are notified viewer events.
|
void |
resetAllPageRotation()
Resets the angle of rotation of pages whose contents have been rotated.
|
void |
rotateAllPagesAntiClockwise()
Rotates displayed contents of all pages in the counter-clockwise direction.
|
void |
rotateAllPagesClockwise()
Rotates displayed contents of all pages in the clockwise direction.
|
void |
rotateAllPagesTo(RotationAngle angle)
Rotate displayed contents of all pages by specified angle.
|
void |
rotatePageTo(RotationAngle angle,
int pageNum)
Rotates contents of specified page by specified angle.
|
void |
rotatePageTo(RotationAngle angle,
String pageRange)
Rotate contents of specified pages by specified angle.
|
void |
setBackgroundColor(Color backgroundColor)
Sets specified background color for the viewer.
|
void |
setBorderWidth(int borderWidth)
Sets specified border width for the viewer.
|
void |
setPageLayout(PageLayout pageLayout)
Displays pages in specified layout.
|
boolean |
zoomIn()
Changes page magnification to the next higher
pre-defined page magnification value . |
boolean |
zoomOut()
Changes page magnification to the next lower
pre-defined page magnification value . |
void |
zoomTo(Zoom zoom)
Changes the page magnification to specified value.
|
int getCurrentPageNumber()
void goToPageNumber(int pageNum) throws XDocException
pageNum
- number of the page.XDocException
- if a viewer error occursint getPageCount()
boolean isDocumentLoaded()
int getBorderWidth()
void setBorderWidth(int borderWidth)
borderWidth
- border width that needs to be set for the viewerZoom getZoom()
void zoomTo(Zoom zoom)
zoom
- page magnification that needs to be appliedViewerPreferences getPreferences()
IDocument getActiveDocument()
void loadDocument(String fileName, String password) throws IOException, FormatNotSupportedException, IncorrectPasswordException, XDocException
fileName
- pathname of the filepassword
- password to decrypt the documentIOException
- if an I/O error occursFormatNotSupportedException
- if the document format is not supportedIncorrectPasswordException
- if an incorrect password was providedXDocException
- if a viewer error occursvoid loadDocument(InputStream inputStream, String password) throws IOException, FormatNotSupportedException, IncorrectPasswordException, XDocException
inputStream
- stream from which the document needs to be loadedpassword
- password to decrypt the documentIOException
- if an I/O error occursFormatNotSupportedException
- if the document format is not supportedIncorrectPasswordException
- if an incorrect password was providedXDocException
- if a viewer error occursvoid closeDocument() throws IOException
IOException
- if an I/O error occursint nextPage() throws XDocException
XDocException
- if a viewer error occursint previousPage() throws XDocException
XDocException
- if a viewer error occursvoid firstPage() throws XDocException
XDocException
- if a viewer error occursvoid lastPage() throws XDocException
XDocException
- if a viewer error occursvoid refresh()
void rotateAllPagesClockwise()
void rotateAllPagesAntiClockwise()
void rotateAllPagesTo(RotationAngle angle)
angle
- angle by which the contents need to be rotatedvoid rotatePageTo(RotationAngle angle, String pageRange)
angle
- angle by which the contents need to be rotatedpageRange
- pages whose contents need to be rotatedvoid rotatePageTo(RotationAngle angle, int pageNum)
angle
- angle by which the contents need to be rotatedpageNum
- number of the page whose contents need to be rotatedvoid resetAllPageRotation()
RotationAngle getRotationAngle()
boolean zoomIn()
pre-defined page magnification value
.boolean zoomOut()
pre-defined page magnification value
.PageLayout getPageLayout()
void setPageLayout(PageLayout pageLayout) throws XDocException
pageLayout
- layout in which pages need to be displayedXDocException
void addViewerListener(DocumentViewerListener viewerListener)
viewerListener
- user-class instance that needs to be addedDocumentViewerListener[] getViewerListeners()
void removeViewerListener(DocumentViewerListener viewerListener)
viewerListener
- listener that needs to be removedList<String> getSupportedFormats()
double getMinZoomVal()
double getMaxZoomVal()
double[] getPredefinedZoomValues()
void setBackgroundColor(Color backgroundColor)
backgroundColor
- background color for the viewervoid dispose() throws IOException
IOException
int[] getVisiblePageNumbers()
Component getComponent()