How to change font encoding when converting docx -> pdf with docx4j?

robson picture robson · Sep 8, 2012 · Viewed 8.2k times · Source

When I'm a converting docx document to pdf my national characters transform into "#" marks.
Is there any way to set a font encoding for pdf documents?

I used xdocreport in the past and it can handle that, but I had problems with images, headers and footers.

Docx4j manages to do this, but not fonts. After conversion, fonts have ANSI encoding while I'd like to have windows-1250. Is there an option to set this?

Answer

robson picture robson · Sep 10, 2012

My problem was - missing proper True Type Fonts on linux server. The default fonts where inserted instead (without my code pages).

I solved the problem installing the default Ms Windows fonts via ttf-mscorefonts-installer

On debian:

apt-get install ttf-mscorefonts-installer