转换docx时如何更改字体编码 - > pdf with docx4j? [英] How to change font encoding when converting docx -> pdf with docx4j?
问题描述
当我将docx文档转换为pdf时,我的国家字符转换为#标记。
有没有办法为pdf文档设置字体编码?
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?
我过去使用过xdocreport它可以解决这个问题,但是我遇到了图像,页眉和页脚的问题。
I used xdocreport in the past and it can handle that, but I had problems with images, headers and footers.
Docx4j设法做到了这个,但不是字体。转换后,字体有ANSI编码,而我想要windows-1250。有没有设置它的选项?
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?
推荐答案
我的问题是 - 在linux服务器上缺少正确的True Type字体。相反插入的默认字体(没有我的代码页)。
My problem was - missing proper True Type Fonts on linux server. The default fonts where inserted instead (without my code pages).
我解决了通过
ttf-mscorefonts-installer 安装默认的Ms Windows字体的问题
I solved the problem installing the default Ms Windows fonts via ttf-mscorefonts-installer
关于debian:
apt-get install ttf-mscorefonts-installer
这篇关于转换docx时如何更改字体编码 - > pdf with docx4j?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!