Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Mar 17, 2022 5:52 pm

Hello, I am trying to run the convert demo (word to pdf) in centos

First try was missing some fonts, than I install using rpm -Uvh msttcore-fonts-2.0-3.noarch.rpm

After that appear another error below, there is a documentation how to run in Linux ?

INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.desktop/sun.awt.FontConfiguration.getVersion(FontConfiguration.java:1262) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.desktop/sun.awt.FontConfiguration.readFontConfigFile(FontConfiguration.java:224) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.desktop/sun.awt.FontConfiguration.init(FontConfiguration.java:106) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.desktop/sun.awt.X11FontManager.createFontConfiguration(X11FontManager.java:706) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:358) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.desktop/sun.font.SunFontManager$2.run(SunFontManager.java:315) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.base/java.security.AccessController.doPrivileged(AccessController.java:318) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.desktop/sun.font.SunFontManager.<init>(SunFontManager.java:315) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.desktop/sun.awt.FcFontManager.<init>(FcFontManager.java:35) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.desktop/sun.awt.X11FontManager.<init>(X11FontManager.java:56) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.desktop/sun.font.FontManagerFactory$1.run(FontManagerFactory.java:85) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.base/java.security.AccessController.doPrivileged(AccessController.java:318) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.desktop/sun.font.FontManagerFactory.getInstance(FontManagerFactory.java:75) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.desktop/sun.java2d.SunGraphicsEnvironment.getFontManagerForSGE(SunGraphicsEnvironment.java:139) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.desktop/sun.java2d.SunGraphicsEnvironment.getAllFonts(SunGraphicsEnvironment.java:158) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at java.desktop/sun.java2d.HeadlessGraphicsEnvironment.getAllFonts(HeadlessGraphicsEnvironment.java:76) ~[na:na]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at com.spire.office.packages.sprjmla.<clinit>(bpg:80) ~[spire.office-5.2.2.jar!/:5.2.2]
INFO|3701/0|SIQ Document Service|22-03-17 17:48:01| at com.spire.office.packages.sprfxla.spr╕╽—(jgg:360) ~[spire.office-5.2.2.jar!/:5.2.2]

meneghette
 
Posts: 42
Joined: Tue Mar 08, 2022 12:10 pm

Thu Mar 17, 2022 5:53 pm

Was missing on error line

INFO|3701/0|SIQ Document Service|22-03-17 17:48:01|java.lang.NullPointerException: Cannot load from short array because "sun.awt.FontConfiguration.head" is null

meneghette
 
Posts: 42
Joined: Tue Mar 08, 2022 12:10 pm

Fri Mar 18, 2022 6:05 am

Hello,

Thank you for your inquiry.
According to your description, I did an initial test, but did not reproduce the issue you mentioned. To help us investigate your issue quickly and efficiently, please provide the following information. You could attach them here or send them to us via email (support@e-iceblue.com). Thanks in advance.
1) Your input Word file.
2) Your complete test project.
3) Your test environment, such as CentOS 7 x64.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1643
Joined: Wed Apr 07, 2021 2:50 am

Fri Mar 18, 2022 11:37 am

After some searchs I run this commands


rpm -Uvh msttcore-fonts-2.0-3.noarch.rpm
sudo yum install urw-fonts

And the problem is sovled

Do you have some documentation of requirements to run on linux, with windows documents ?

meneghette
 
Posts: 42
Joined: Tue Mar 08, 2022 12:10 pm

Mon Mar 21, 2022 1:25 am

Hello,

Glad to hear that this issue was solved by yourself.
According to the solution you provided, the issue is caused by the system not having the relevant fonts used in the Word file installed. Kindly note that since the fonts used in each word file may be different, our Spire.Doc will look for the relevant fonts from the system when the file is converted. If it is not found, the program may report an error or the content of the result file will be displayed incorrectly. Hope you can understand.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1643
Joined: Wed Apr 07, 2021 2:50 am

Return to Spire.Doc