I am using OpenViewerFX (JPedal) to display PDF files in a JavaFX application. Some files are displayed well, others only show not printable characters (in documents created by myself and also documents from other people). See for example this one:
This is my code:
private final PdfDecoderFX pdf = new PdfDecoderFX();
private Group group;
@Override
public void start(Stage stage) {
BorderPane bp = new BorderPane();
Scene scene = new Scene(bp, 400, 400);
stage.setScene(scene);
stage.show();
group = new Group();
group.getChildren().add(pdf);
bp.setCenter(group);
Platform.runLater(() -> {
try {
pdf.openPdfFile("D:\\Dokument1.pdf");
decodePage();
} catch (PdfException e) {
e.printStackTrace();
System.out.println(e.getMessage());
}
});
}
private void decodePage() {
try {
pdf.setPageParameters(2.0f, 0);
pdf.decodePage(1);
pdf.waitForDecodingToFinish();
} catch (final Exception e) {
e.printStackTrace();
System.out.println(e.getMessage());
}
}
The PDF file was created from a Word document with Adobe PDF printer. I used the standard font and only standard characters. I tested several settings when creating the file, including
- Compatibility "PDF 1.3" to "PDF 1.7"
- Enable/Disable web optimization
- Include all fonts
- Include Open-Type fonts
but always the same result.
What could I be doing wrong?

Seems like a font issue to me. The debugging output helped me in the past - at least I saw some error message in there. I'm not quite sure what the correct option was but try the following:
What does the
org.jpedal.PdfDecoder.getPageDecodeStatus(int type)state where type is any value Defined inorg.jpedal.parser.DecodeStatusWe use a patched version of the ViewerFX - can you try that one?
Are you sure you specified the correct path to the fonts? To add a whole directory of fonts via JVM flag set the JVM flag
-Dorg.jpedal.fontdirs=dirListwhere dirList is a comma-separated list of possible directories.What is your OS? Windows or Linx?
Did you also try the
-Dorg.jpedal.inclusiveLogFilter= "memory,error"JVM option?Try to set
-Dverbose=trueCall
GUI.debugFX=true;see here.