public class OpenViewerFX extends SharedViewer
If you are compiling, you will need to download all the examples source files from : How to View PDF File in Java.
Run directly from jar with java -cp jpedal.jar org.jpedal.examples.viewer.FXStartup (needs Java8)
There are plenty of tutorials on how to configure the Viewer on our website Support Section.
See Here for Settings to Customise the PDF Viewer
We also have our Swing Viewer documented at :
Swing Viewer Documentation.
If you want to implement your own there is a very simple example at : BaseOpenViewerFX Demo
We recommend you look at the full viewer as it is totally configurable and does everything for you.
| Modifier and Type | Field and Description |
|---|---|
static boolean |
isOpenFX |
closeCalled, commonValues, currentCommands, currentGUI, exitOnClose, PREFERENCES_BEAN, PREFERENCES_DEFAULT, PREFERENCES_NO_GUI, PREFERENCES_NO_SIDE_BAR, PREFERENCES_OPEN_AND_NAV_ONLY| Constructor and Description |
|---|
OpenViewerFX(javafx.scene.Parent parentPane,
String preferencesPath)
Constructor to use when embedding the JavaFX Viewer in your own
JavaFX application, pass in your parentPane and the Viewer will
become a child of the parentPane.
|
OpenViewerFX(javafx.stage.Stage stage,
String[] args)
Base Constructor to use when starting Viewer as a stand alone Stage.
|
| Modifier and Type | Method and Description |
|---|---|
protected static void |
checkUserJavaVersion() |
void |
close()
Releases all resources used by the viewer - Please note this calls System.exit(0);
This method has to be called when you explicitly want
to close the viewer.
|
javafx.scene.layout.BorderPane |
getRoot()
Not part of the API.
|
void |
handleArguments(String[] args)
Allows the viewer to handle any JVM/Program arguments.
|
void |
setupViewer()
Sets up the Viewer and Displays it.
|
addExternalHandler, dispose, executeCommand, getPdfDecoder, getSwingGUI, init, isFX, isProcessing, loadProperties, loadProperties, openDefaultFile, openDefaultFileAtPage, setRootContainerpublic OpenViewerFX(javafx.stage.Stage stage,
String[] args)
stage - Is of type Stageargs - Program arguments passed into the Viewerpublic OpenViewerFX(javafx.scene.Parent parentPane,
String preferencesPath)
Please ensure you call setupViewer after calling this constructor.
To add the JavaFX Viewer to a Tab, please pass a Pane or ScrollPane and add the passed Pane to the Tab.
parentPane - Is a constructor of your own JavaFX application in which JavaFx Viewer will be embeddedpreferencesPath - The path of the preferences filepublic void setupViewer()
Please make sure you call this method after calling any constructor to initialise key components.
setupViewer in interface ViewerIntsetupViewer in class SharedViewerpublic void handleArguments(String[] args)
handleArguments in interface ViewerInthandleArguments in class SharedViewerargs - :: Program arguments passed into the Viewer.public void close()
public javafx.scene.layout.BorderPane getRoot()
To add Viewer to your own parent node, please use: OpenViewerFX(Parent parentPane, String preferencesPath).
protected static void checkUserJavaVersion()
Copyright © 2017. All rights reserved.