Access Viewer Functions
Once you have integrated a Viewer component, you may want to access its functions from your own code. This section explains how to do this.
How to interact with this PDF display
To interact with this display is simple and it can all be handled through one method.
simpleViewer.executeCommand(int, object[]) - Click here to view this method.
This method uses an int to specify what you wish to do and the object[] specifies input arguments where certain methods require it for full customisation, otherwise the method will use the standard jpedal code. This will be useful if you wish to use your own popup windows for loading pdfs, printing etc.
The int values to specify a command to be used can be found in Commands.java.
The following methods will accept an object[] input.
Commands.OPENFILE :: input = {"/PDFData/example.pdf"}
Input should be the full filename expressed as a string
Commands.OPENFILE :: input = {data, "/PDFData/example.pdf"}
Input should be a byte array of the pdf data you wish to load and the filename expressed as a string
Commands.FORWARDPAGE :: input = {"3"}
Input should be the amount of pages to move by expressed as a string
Commands.BACKPAGE :: input = {"3"}
Input should be the amount of pages to move by expressed as a string
Commands.ROTATION :: input = {"90"}
Input should be the page rotation expressed as 0, 90, 180 or 270 expressed as a string
Commands.OPENURL :: input = {"http://www.cs.bham.ac.uk/~axj/pub/papers/handy1.pdf"}
Input should be the full url including "http://" at the start expressed as a string
Commands.SCALING :: input = {"300"}
Input should be the scaling value expressed as a string
Commands.FIND :: input = {"example", 0, true, false}
Input should be, as above, in the following order.
String representing the term or terms to be searched for.
Integer value representing a bitwise OR of the static values stored in the class SearchType representing search options.
Boolean value, if true, will treat search value as a list seperated by a space between each value else will treat the entire string as a single search term.
Boolean value, if true, will only search the current page else the entire document is searched.











