thSoft/eclipse-commons

PDF view does not display texts on OS X

Closed this issue · 19 comments

I cannot reproduce this on Windows... Maybe this is another Mac JavaFX issue.

I asked my colleague to open a corresponding pdf in the score view on his mac. There the text is displayed. I will update this comment, when I know which MacOS- and Java-Versions were used.

Here is the full system configuration:
system-configuration.txt

My colleage successfully opened a score view with text using MacOS (10.11.5) using Mars and Oracle Java 1.8.0_60-b27. Do you have a chance to test a more recent Java version?

I cannot reproduce this using Windows and Java 1.8.0_25. Could you use the code from https://docs.oracle.com/javase/tutorial/2d/images/saveimage.html in RenderJob#obtainImage for saving the image in order to verify that rendering is the problem.

Please also try the following:

  • Open other pdfs containing text (not created by LilyPond) in the Score view.
  • Use a separate minimal application/unit test to read other pdfs (with text in different fonts) extracting a page as image and save them in the same way, in order to check whether rendering text is a general problem.
  • Try if using other font (families) in the sources makes any difference.
  • Are commands that output text (like forte etc) also not shown correctly?

And again, try with a recent Java version.

Note also that since the initial migration to OpenViewerFX there have been further releases:
https://mvnrepository.com/artifact/org.jpedal/OpenViewerFX
http://central.maven.org/maven2/org/jpedal/OpenViewerFX/7.4.01/

It might make sense to try also with a more recent version.

I'll have a go at this one again.

Unfortunately, I couldn't get any PDF file to display properly, even with updating to OpenViewerFX 7.4.01. I suspect this is a weird OS X issue, so I'll try this on one of my colleagues' MacBook.

Would updating to the latest version make sense anyway?

Also, my colleague could also reproduce this bug on his machine, so it needs further investigation.

If I remember correctly, this was not caused by the update to the new JPedal version but a later commit. I'll try to bisect here ...

I'm going to test this again with Java 9. Let's hope the issue is fixed in it.

My foundings after two desperate evenings:

Conclusion: I recommend dropping JPedal entirely (see #24). What are your thoughts and feelings about this, @nittka?

I'd recommend the following steps:
First, we try to replace JPedal in the current trunk versions (leaving Java and Xtext versions untouched). If this works, we can go on to upgrading to newer Java+Xtext. If it does not work, you first have to decide what to do about the pdf problem. (Are the earlier JPedal versions not open source anymore? What about https://mvnrepository.com/artifact/org.jpedal/OpenViewerFX? Do versions between the one introduced for performance and the one used before suffer the same problems?)

Maybe, even before replacing JPedal completely, could you check with the versions available and a minimal open/transform pdf example (independent of Elysium etc.), whether you can reproduce/solve the problem of the missing text?

Thanks for sharing the repo, I'll try with other versions before dropping JPedal.

I created a test branch in my clone (see commit above). Maybe this can help you track down a JPedal version that does not suffer this problem. The first line is for initializing the toolkit. The access restriction error does not prevent the creation of the jpg file on my system.
I guess with earlier and later versions a similar "getImageFromPdf" method is available (or has been used by you in working versions).

Let me know if this helps.

Thank you very much, this was a bug in JPedal 6.9 which was fixed several versions later. This issue is finally resolved, I'm going to release a new version soon which contains all your fixes and enhancements. Sorry for deferring this so much!

I was just wondering what prevented you from using JPedal 7.

Simple: it has breaking API changes which I didn't want to deal with. :D