The problem scenario has a requirement to convert word documents to PDF format. Testing is OK in the Windows native environment, but deployed to the test environment on Linux. The content of the converted PDF file is in Chinese or the form is garbled.

Solution

Place font files on Windows on Linux and authorize them. You do not need to restart the server, only the service.

Environment:

jdk8+springboot+centOS7+spire.doc

Steps:

1. In the C :/ Windows /font directory on the Windows operating system, copy the names of song Typeface and bold text (simsun. TTC and simhei.ttf respectively) to the Linux server. You can copy them all if you’re worried. 2. Check whether the “fonts” directory exists in the /usr/share directory on the Linux server. If not, run the following command: yum -y install fontconfig 3. If this cannot be done, Linux yum Update 4 needs to be updated. Place the font files in the /usr/share/fonts directory or create your own folder 5. Chmod -r 755 /usr/share/fonts/sim* if your own folder 6. Install font ttmkfdir retrieval tools and perform the yum command – y install ttmkfdir ttmkfdir – e/usr/share/X11 / fonts/encodings/encodings. Dir. 7. 8. Check whether the new font fc-list 9 is loaded. Restarting background Services