opensagres / xdocreport

XDocReport means XML Document reporting. It's Java API to merge XML document created with MS Office (docx) or OpenOffice (odt), LibreOffice (odt) with a Java model to generate report and convert it if you need to another format (PDF, XHTML...).
https://github.com/opensagres/xdocreport
1.23k stars 375 forks source link

Cambodian language #575

Open L-G-v1 opened 2 years ago

L-G-v1 commented 2 years ago

Hi, Our Word documents are generated using DocxReport in opensagres and Freemarker template engine . The issue that we're facing is that some documents need to support some Cambodian characters like this: ម្រេចកំពត . At this point after generation Word documents ,instead of Cambodian characters some utility boxes are displayed.

Do you have an idea of how this could be handled ? I mean is there a way to config opensagres with a specific font ? From what I've seen the native font for Cambodian is DaunPenh (on Windows 10 Enterprise). Also is there an option to embed this font in the Word document ?, in order to not rely on system fonts..

I've also thought of altering the document.xml after the document is processed, in order to do what Word is doing(if the native font is missing, Word is wrapping Cambodian characters with Leelawadee UI font on Windows 10 Enterprise). But I couldn't succeed in defining a custom DocXReport, since the service discovery is based on META-INF files.. Is there a way to define a custom one ?

If you have any other suggestions, please say. Many thanks !

EJTang commented 2 years ago

I am having this exact same issue. Though depending on the template it seems to not render anything for Khmer, but works for all other text on the page.

angelozerr commented 2 years ago

The problem comes from the generated docx or convert to pdf?

L-G-v1 commented 2 years ago

from generated docx and it reflects in pdf conversion as well.