Hi Aspose -
We running into problem rendering presentations that are using non-latin characters using Aspose.Slides.
We’ve setup a simple program that takes a presentation and outputs a PDF as follows:
LoadOptions loadOptions = new LoadOptions();
loadOptions.setWarningCallback(new WarningCallback());
Presentation doc = new Presentation(filename, loadOptions);
PdfOptions options = new PdfOptions();
options.setWarningCallback(new WarningCallback());
doc.save(outputFilename, SaveFormat.Pdf, options);
We output the warnings with the following code:
class WarningCallback implements IWarningCallback {
@Override
public int warning(IWarningInfo warningInfo) {
System.out.println("Warning: " + warningInfo.getDescription());
return ReturnAction.Continue;
}
}
The presentation is created on a Window computer and being rendered on a Linux computer. The Windows and Linux computer does not have the same fonts installed, but the Linux computer has fonts that can be used as fallbacks for every language in the presentation.
However when we load and render presentations we see that a lots of font substitutions to fonts that does not properly support the languages. In other words Aspose.Slides is not picking the best font for the text that needs to be rendered.
We are currently facing problems rendering characters for the following languages:
- Chinese (Simplified)
- Chinese (Traditional)
- Japanese
- Korean
- Punjabi
- Thai
- Tamil
- Urdu
- Hindi
Attached is sample code: AsposeSlidesTest.zip (322.6 KB).
To build run:
./gradlew shadowJar
To run:
java -jar build/libs/AsposeSlidesTest-1.0-all.jar Languages.pptx encoding.pdf
Here is an example of the rendered outcome: encoding.pdf (157.5 KB)