org.jpedal.examples.api.APIForOpenVIewerFX Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of OpenViewerFX Show documentation
Show all versions of OpenViewerFX Show documentation
Open Source (LGPL) JavaFX PDF Viewer
/*
* ===========================================
* Java Pdf Extraction Decoding Access Library
* ===========================================
*
* Project Info: http://www.idrsolutions.com
* Help section for developers at http://www.idrsolutions.com/support/
*
* (C) Copyright 1997-2017 IDRsolutions and Contributors.
*
* This file is part of JPedal/JPDF2HTML5
*
@LICENSE@
*
* ---------------
* APIForOpenVIewerFX.java
* ---------------
*/
package org.jpedal.examples.api;
import java.io.File;
import javafx.stage.Stage;
import org.jpedal.examples.baseviewer.BaseViewerFX;
import org.jpedal.examples.viewer.Commands;
/**
* This is where we log all public methods in BaseViewer, Viewer and plugin
*
* @author markee
*/
public class APIForOpenVIewerFX {
public static void main(final String[] args) {
plugin();
viewerFX();
}
/**
* this contains links to all variables and methods which need to be public for FX plugin
*/
static void plugin() {
final int checkIntIsPublic = Commands.GETPDFNAME;
System.out.println(checkIntIsPublic);
final BaseViewerFX baseViewerTest = new BaseViewerFX();
baseViewerTest.setupViewer(0, 0);
baseViewerTest.addListeners();
baseViewerTest.loadPDF(new java.io.File("test.pdf"));
}
static void viewerFX() {
final BaseViewerFX instance = new BaseViewerFX();
instance.start(new Stage());
instance.setupViewer(10, 10);
instance.addListeners();
final String[] files = {"a.pdf", "b.pdf"};
for (final String file : files) {
instance.loadPDF(new File(file));
try {
instance.loadPDF(file);
} catch (final Exception ex) {
ex.printStackTrace();
}
final String result = instance.getPDFfilename();
if (!result.equals(file)) {
System.out.println(file + ' ' + result);
}
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy