Page 1 of 1

Chinese ("SimSun") styles

PostPosted: Sat Jan 30, 2016 6:30 am
by pipo4j
Hi, Jason.

This is a new kid on the forum! ;)

Recently, I've been starting to work with Docx4J, due to a need to convert some DOCX documents to PDF.
But, all of the documents are in several languages (english, spanish, russian, chinese, japan, and so on...)
Dealing with "SimSun" chinese font, I can see that the system can "load" it but, when the original DOCX document finds a "bolded" chinese character, it fails. The original font "simsun.ttc", does not contain any "bold" information and Docx4J, simply says:

"org.docx4j.openpackaging.exceptions.Docx4JException: Exception setting up result for fo transformation: Failed to resolve font with embed-url 'file:/Users/xxx/.docx4all/temporary embedded fonts/1454072262481-SimSun-bold.ttf'"

I must say that the original document comes from a Windows-based system and the conversion MUST be done in within a Linux server.

Trying to find out a file containing a "bolded" version of the "SimSun" font, I stopped and wandered whether Docx4J can "simulate", in any way, "styles" (this is, bold, italic, ...) when these font files can not be found.

Or, can I configurate something (Docx4J, FOP, whatever) to perform the conversion with only the "normally-styled-font" file?


By the way, do you have any "chinese" Java sample code, if applies?

Many thanks in advance.