My Code snippet is
DocumentBuilder w_Bldr = new DocumentBuilder();
//w_fontFolder has arialunicode font.
FontSettings.setFontsFolder(w_fontFolder.toString(), false);
w_Bldr.getFont().setName("Arial Unicode MS");
w_Bldr.write("ความรัก");
//working fine when chinese characters are present
//eg:w_Bldr.write("我喜欢学习多种语t a");
Document w_Doc = w_Bldr.getDocument();
w_Doc.save("abc.doc")
So when doc is getting printed the characters are getting corrupted.
How to fix?
The attached doc has font set to Arial if u see on top.
Also in Microsoft word also it is getting set to Arial
@ruchita93 Unfortunateluy, I cannot reproduce th eproblem on my side using the latest 24.5 version of Aspose.Words for Java. The following code:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
builder.getFont().setName("Arial Unicode MS");
builder.write("ความรัก");
doc.save("C:\\Temp\\out.doc");
produces the following document on my side: out.zip (1.7 KB)
Here is how document looks in MS Word:
And here is how it looks in WPS Office:
@alexey.noskov So is it aspose.words issue or the downloaded doc issue since the downloaded document has Arial set instead of Arial Unicode MS.
@ruchita93 Most likely Arial Unicode MS
font is not available on your side.