We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Georgian characters displayed as white boxes

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.

@LaMachina

Please note that Aspose.Words requires TrueType fonts when rendering document to fixed-page formats (JPEG, PNG, PDF or XPS). You need to install font ‘Helvetica Neue’ on the machine where you are converting document to PDF.

If you still face problem, please ZIP and attach ‘Helvetica Neue’ font here for testing. We will investigate the issue on our side and provide you more information.

The problem appear to indeed be linked to installed fonts : mscore fonts ttf linux package only include standard arial, and not full unicode arial. I thought the package included all languages, but I was mistaken. After installing full unicode arial, georgian characters are rendered correctly.

@LaMachina

Thanks for your feedback. It is nice to hear from you that your problem has been solved. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.