Command Line DOCX to PDF Characters Just Blank Squares

I have installed LO 3.5 on my Amazon EC2 Ubuntu instance. I use it for converting DOCX files to PDF. For English files, it works with no issues. However, for a Chinese file, the resulting PDF has all square characters. I’ve tried adding a lot of language-pack-* packages and installed ttf-mscorefonts-installer, but I still can’t get the conversions to maintain the characters.

You problem sounds like the same character encoding issue as discussed in this thread. Unfortunately there is no satisfactory resolution to that thread as yet. The thread here is possibly also related, or at least offers another method of examining your file. It is likely because the characters in question use GB3212 or similar (GBK or GB18030) encoding.

Given the ttf-mscorefonts reference, I assume you are using GNU/Linux. Try testing your font fallback status for the font used in the document:

$ fc-match -v 'name_of_font' | grep 'family\|lang'

Also test your locale to ensure you have zh_CN zh_CN.gb18030 zh_CN.gb2312 zh_CN.gbk zh_CN.utf8 types of support. You are also going to need a font that supports the encoding in question.

I don’t know if this is really an “answer”, but it’s more than a “comment”.

I am aware that complex-script handling has improved dramatically for LibO from version to version. There was a “watershed” moment in one version increment, but I forget which one and can’t find details just now.

It would be well worth installing (latest version) and see if that helps. You could also check Tools > Options... > Language Settings > Languages and check to see that the “Asian” option is activated (there may also be something OS specific here, but it sounds like you’re on top of that already):

You could then check (same dialog, under “LibreOffice Writer”) to see what font settings LibO is using for the Asian fonts.

Not sure there’s a solution here, but hope it helps all the same!

I think the solution below may have been correct, but simply adding the LibreOffice 4.0 PPA and running an `apt-get install libreoffice’ fixed it. Thank you.

Me too I don’t know if my answer helps but I can show you my setting for Japanese. The equivalent settings for Chinese should be made at you LibO to exclude this possible route cause.

I assume that you have Chines fonts installed.

I use XP Pro / SP3 as OS