public class BaseViewerFX
extends javafx.application.Application
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/baseviewer/BaseViewerFX
There are plenty of tutorials on how to configure the Viewer on our website Support Section.
This class provides example code to create a bare-bones PDF Viewer in JavaFX.
Click here for a bare-bones PDF Viewer in Java Swing.
For more help and tutorials, visit our websites Support Section.
| Modifier and Type | Class and Description |
|---|---|
static class |
BaseViewerFX.FitToPage |
| Constructor and Description |
|---|
BaseViewerFX() |
| Modifier and Type | Method and Description |
|---|---|
void |
addExternalHandler(PluginHandler customPluginHandle) |
void |
addListeners() |
String |
getPDFfilename() |
void |
loadPDF(File input)
Take a File handle to PDF file on local file system and displays in PDF viewer
|
void |
loadPDF(String input)
Take a File handle to PDF file on local file system and displays in PDF viewer
|
static void |
main(String[] args) |
javafx.scene.Scene |
setupViewer(int w,
int h)
creates all the components and adds change listeners for auto-centering
for JavaFX PDF viewer
|
void |
start(javafx.stage.Stage stage)
launches BaseViewerFX viewer using supplied stage for displaying PDF files
|
public static void main(String[] args)
public void start(javafx.stage.Stage stage)
start in class javafx.application.Applicationstage - is of type final Stagepublic javafx.scene.Scene setupViewer(int w,
int h)
w - The width to use for the viewerh - The height to use for the viewerpublic void addListeners()
public void loadPDF(File input)
input - The PDF file to load in the viewerpublic void loadPDF(String input)
input - The PDF file to load in the viewerpublic String getPDFfilename()
public void addExternalHandler(PluginHandler customPluginHandle)
Copyright © 2017. All rights reserved.