|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.faceless.pdf2.JSEngine
public final class JSEngine
This class handles the running of all JavaScript on the document. It's not required
to read or edit the JavaScript actions the make up a document - it's used to actually
run those actions, typically by an interactive application like the PDFViewer
.
This requires a JavaScript implementation, which means at least Java 1.6
or the use of Mozilla Rhino.
Although this class is public there is generally no reason to call the methods in this class directly, unless you're implementing your own PDF Viewer or modifying the JavaScript security permissions.
Constructor Summary | |
---|---|
JSEngine(JSCoreMethods core)
Create a new JSEngine |
Method Summary | |
---|---|
String |
getImplementationDescription()
Get a human-readable description of the JavaScript implementation |
String |
getImplementationType()
Get a the type of JavaScript implementation |
boolean |
runEvent(JSEvent event)
Raise and run the specified JavaScript event. |
static void |
setPermissions(Permissions perms)
Set the Permissions that are allowed for any JavaScript run by the PDF Library. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JSEngine(JSCoreMethods core)
core
- the JSCoreMethods implementation to useMethod Detail |
---|
public String getImplementationDescription()
public String getImplementationType()
public static void setPermissions(Permissions perms)
Set the Permissions that are allowed for any JavaScript run by the PDF Library. The JavaScript engines supplied with most Java 1.6 implementations and Mozilla Rhino both allow access to the full Java class hierarchy, so it's important to place restrictions on what actions JavaScript in a PDF can perform, otherwise simply setting a field value with the PDF library could run any Java commands on your system.
By default, a minimal set of the permissions are in place. Enforcing permissions
requires a SecurityManager
, and the JavaScript engine will install one
if none is set.
public boolean runEvent(JSEvent event)
event.rc
- true if the event succeeded, false otherwise
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |