Free Support Forum - aspose.com

Unreadable code in generated picture file

Hi Team
Now I want to save the image of Shape to a picture file in Solaris System,but if the Shape Object contains chinese character,the chinese character will display unreadable code in the generated picture file.What should I do.

The Sample Code as follow

Run run = new Run(shape.getDocument());
run.setText("中文字符");
para.appendChild(run);
shape.appendChild(para);
shape.getShapeRenderer().save("c:\\test.bmp");

Hi,


Thanks for your inquiry. It may be that the problem occurs because the font you are using on your side does not contain glyphs for Chinese characters. Moreover, please note that Aspose.Words requires TrueType fonts when rendering documents and otherwise it performs fonts substitution during rendering a document. So, if the font is not available when the document is rendered, it will be replaced with an alternative font which can destroy Chinese text. To overcome this problem, you please simply install a Chinese font on the machine, where rendering of the document is performed. For more information, please read the following article:
http://www.aspose.com/docs/display/wordsjava/How+Aspose.Words+Uses+True+Type+Fonts

I hope, this helps.

Best Regards,