Free Support Forum - aspose.com

Docx conversion fails when file contains equation

Hello,

There seems to be a bug in Aspose.Words whereby some .docx files that contain equations cannot be converted. I’ve attached a sample .docx file that fails. To see the bug, try converting it to RTF.

Here is the error that I receive:

default  14:07:40.421991 +0200   Scrivener   Aspose conversion error: Exception in thread "main" java.lang.UnsatisfiedLinkError: sun.font.FreetypeFontScaler.initIDs(Ljava/lang/Class;)V
    at sun.font.FreetypeFontScaler.initIDs(Native Method)
    at sun.font.FreetypeFontScaler.<clinit>(FreetypeFontScaler.java:50)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:188)
    at sun.font.FontScaler.<clinit>(FontScaler.java:98)
    at sun.font.TrueTypeFont.getScaler(TrueTypeFont.java:1248)
    at sun.font.FileFontStrike.<init>(FileFontStrike.java:177)
    at sun.font.FileFont.createStrike(FileFont.java:95)
    at sun.font.Font2D.getStrike(Font2D.java:344)
    at sun.font.Font2D.getStrike(Font2D.java:289)
    at sun.font.FontDesignMetrics.initMatrixAndMetrics(FontDesignMetrics.java:358)
    at sun.font.FontDesignMetrics.<init>(FontDesignMetrics.java:350)
    at sun.font.FontDesignMetrics.getMetrics(FontDesignMetrics.java:302)
    at sun.java2d.SunGraphics2D.getFontMetrics(SunGraphics2D.java:800)
    at asposewobfuscated.zzR0.zzZ(Unknown Source)
    at asposewobfuscated.zz3.zzZ(Unknown<…>

Note that you might have to test on a clean system. The bug was reported to me by a user, and a colleague reproduced it. I also reproduced it on one machine, but not on another. Given that the error relates to fonts, I’m guessing that the problem might be a missing font that perhaps one of my machines has, thus avoiding the error.

Thanks and all the best,
Keith

import_me_fails.docx.zip (21.3 KB)

@kayembi,

Thanks for your inquiry. After an initial test with the licensed latest version of Aspose.Words for Java i.e. 18.9 , we were unable to reproduce this issue on our end. We would suggest you please upgrade to the latest version of Aspose.Words for Java. Hope, this helps.

Thanks for the reply. I’m afraid I’m seeing the issue in the latest version, 19.9, though. I forgot to mention that I’m running on a Mac, which might be relevant. As I say, I’m not seeing it on all machines - it works fine on one of my machines running macOS 10.13. I see a failure on my machine running the macOS 10.14 beta, but it’s not down to 10.14. My colleague is seeing the same error on macOS 10.13, and the user who reported the issue is also running macOS 10.14.

Unfortunately, I haven’t managed to narrow down the difference between the systems. You might be able to reproduce it by testing in Safe Mode on macOS 10.13.

Thanks and all the best,
Keith

@kayembi,

We are checking this scenario and will get back to you soon.

@kayembi,

Regarding WORDSJAVA-1898, please try to upgrade your current JDK to the latest version and see if the bug disappears on your end if another JDK version is used?

Please also provide the exact OS version and its architecture x64 or x86 (32-bit or 64-bit etc). What Java version are you currently using on your end? Thanks for your cooperation.

Hello,

I finally got chance to update Java, and things seem to be working fine now. I was using Java 1.6 with the latest version of Aspose.Words on a 64bit Mac (but this was a problem on all Macs running Java 1.6 with Aspose). I have just updated to the OpenJDK runtime, version 10, and the file imports fine, so it does seem to have been down to the Java version, as you suspected.

Many thanks,
Keith

@kayembi,

It is great that you were able to resolve this issue on your end. We have also logged your comment in our issue tracking system. We will keep you posted on any further updates.