Free Support Forum - aspose.com

Docx to jpg Garbled

I tried using the code but it didn’t work?
Is there any other way?
docx document
中文乱码.zip (10.1 KB)
converted jpg file
中文乱码.jpg (64.6 KB)

LoadOptions opt = new LoadOptions();
opt.setEncoding(Encoding.CHARSET_GB2312);
Document doc = new Document(inputstream,opt);
FontInfoCollection fonts = doc.getFontInfos();
fonts.setEnbedTrueTypeFonts(true);
fonts.setEmbedSystemFonts(false);
fonts.setSaveSusetFonts(false);
FontSettings fontsettings = FontSettings.getDefaultInstance();
fontsettings.setFontsFolder("/static/font/chinese/",true);
doc.setFontSettings(fongsettings);
doc.save(outputstream,SaveFormat.PNG);

/static/font/chinese/ This folder is the required fonts under my application

thanks!!!

A post was merged into an existing topic: Rendering of Custom Fonts in Word Document