Search code examples
javafreemarkerxdocreport

Opensagres - Generate Word document that support Cambodian language


All the documents generated in our application are generated with java-11 + opensagres /xdocreport-2.0.2 + Freemarker template engine. The documents are generated correctly in multiple languages like: Russian and Chinese.

We've observed that when the input is in Cambodian language the Word document generated contains some utility boxes instead of Cambodian characters.

I've explained more in detail the issue here: https://github.com/opensagres/xdocreport/issues/575 , but I didn't receive any answer until now.

Did anyone manage to generate documents containing this language with opensagres ?

Thanks upfront!


Solution

  • The answer was, using Aspose framework(this is not free like opensagres). The biggest advantages are that in Aspose you can force the framework to use some sets of fonts from the application resources and other great features(like smooth and simple pdf convertions).

    The only trouble was that Aspose doesn't have integration with Freemarker template. In our case that meant changing a lot of quite big complex existing documents.

    After some analyses and based on Aspose really kind support, we took the decision to use a hybrid solution like:

    1. Documents would be still generated in memory with Opensagres and Freemarker
    2. After that the documents will be loaded with Aspose, and render based on the application resources fonts. The native font for Cambodian characters is Daunpenh Font. This font was placed in application resources.

    The full topic can be found here: https://forum.aspose.com/t/support-cambodian-language/252057