This is a JavaFX PDF-Viewer Control written in Kotlin.
It is based on PDFViewFX
- mouse zooming/panning (with Cmd/Alt)
- viewport indicator in thumbnail
- panning in thumbnail
- page wise rotation (with thumbnail)
- Java 11+
- Kotlin 1.8+
This project builds with Java 11 but 15, 17, 19 also works.
- Maven
<dependency>
<groupId>de.confinitum</groupId>
<artifactId>kpdfx</artifactId>
<version>1.0.0</version>
</dependency>
- Gradle
implementation 'de.confinitum:kpdfx:1.0.0'
Look at PdfViewController for basic idea how to use this control.
- Kotlin
// create Control
val pdfView = PDFView().also {
// tweak properties
it.setShowThumbnails(false)
it.setThumbniailSize(150.0)
}
// add it to parent
somePane.children.add(pdfView)
// load pdf file
pdfView.load(file)
- Java
PDFView pdfView=new PDFView();
pdfView.setShowThumbnails(false);
pdfView.setThumbnailSize(150.0);
// VBox.setVgrow(pdfView, Priority.ALWAYS);
somePane.getChildren().add(pdfView);
pdfView.load(file);
- Clone the repo
- Run the Demo App
gradlew clean run
Distributed under the Apache 2.0 License. See LICENSE for more information.