Hello,
We have an issue with converting our doc files to pdf when they contain Georgian characters, using latest version of aspose word for java (we’re currently using 18.11, but I tested on 19.4 to make sure it wasn’t a solved issue). The georgian character get turned into white boxes in the pdf. Our machines all have windows ttf installed.
Original text (random georgian characters for testing) :
სწორი
qsd
მკვლელი
Word output:
gerogien - Preview (3).zip (23.8 KB)
PDF Output:
gerogien - Preview (12).pdf (89.1 KB)
The only relevant warning is this one, but arial should have georgian characters if I understood correctly :
Font ‘Helvetica Neue’ has not been found. Using ‘Arial’ font instead. Reason: default font setting.
Here is the code responsible for the conversion :
private static byte[] wordToPdf(final byte[] word) {
try (ByteArrayOutputStream result = new ByteArrayOutputStream()) {
final Document document = loadWord(word);
final PdfSaveOptions so = new PdfSaveOptions();
so.setTextCompression(PdfTextCompression.NONE);
so.setUseHighQualityRendering(true);
so.setUseAntiAliasing(true);
so.setEmbedFullFonts(false);
document.save(result, so);
return result.toByteArray();
} catch (final Exception e) {
throw new Rethrow(e);
}
}
private static Document loadWord(final byte[] doc) throws Exception {
try (ByteArrayInputStream input = new ByteArrayInputStream(doc)) {
final LoadOptions lo = new LoadOptions();
lo.setLoadFormat(LoadFormat.AUTO);
lo.setEncoding(StandardCharsets.UTF_8);
return new Document(input, lo);
}
}
getFontEmbeddingMode return 0, which seems correct.
Thanks in advance for any help on this issue.