Thai symbols look like boxes while docx to pdf convertion

Hello Support Team,

Our client has technical question.
Client: A R, Sanjay sanjay.ar@ecolab.com
Product: Aspose.Words for Python via .NET
OS: Linux
Issue:
Regarding Thai language I have created a docx file using python docx with Thai symbols, word file has been created as expected, when I convert the work to PDF I’m seeing boxes in the PDF.

How is it that python docx libs have access to the fonts in my system to create the word file, but Aspose lib doesn’t?
I tried font embedding as true, still same issue, do you have any suggestion for me? Currently this will be a blocker for us.

doc = aw.Document(docx_path)
save_options = aw.saving.PdfSaveOptions()
save_options.embed_full_fonts = True
doc.save(pdf_path,save_options)


This Topic is created by alexey.butalov using Email to Topic tool.

@alexey.butalov

It seems that you are experiencing an issue with Thai symbols appearing as boxes when converting a DOCX file to PDF using Aspose.Words for Python. This is often related to font availability and rendering issues.

Here are some suggestions to help resolve this problem:

  1. Font Availability: Ensure that the fonts used in your DOCX file are installed on the system where the conversion is taking place. Aspose.Words relies on the fonts available in the environment, and if the required Thai fonts are not present, it may substitute them with default fonts, leading to the display of boxes.

  2. Font Embedding: You mentioned that you have already set embed_full_fonts to True. This is a good step, but make sure that the fonts you are using in the DOCX file support Thai characters and are embeddable. Not all fonts allow embedding, which can lead to issues during conversion.

  3. Advanced Typography Features: Some complex scripts, including Thai, may require advanced typography features to render correctly. You might need to enable these features in Aspose.Words. Check if there are options available in the library to support advanced typography for better rendering of Thai characters.

  4. Testing with Different Fonts: If possible, try using different fonts that are known to support Thai characters and see if the issue persists. This can help identify if the problem is specific to the font being used.

  5. Check for Font Substitution Warnings: Aspose.Words can provide warnings if it substitutes fonts during processing. Make sure to check for any such warnings in your logs, as they can give you insight into which fonts are being replaced.

If these suggestions do not resolve the issue, consider reaching out to the Aspose support forum for more tailored assistance. You can provide them with details about the fonts you are using and any error messages or warnings you encounter during the conversion process.

Feel free to ask if you have any further questions or need additional assistance!

@sanjay.ar Could you please attach your problematic input and output documents here for testing? We will check the issue and provide you more information.

Hi Alexey,

I was able to fix the Thai font issue, on my windows machine I had to “install fonts for all languages” (C:\Windows\Fonts) and then test, it seems to be working as expected.

@sanjay.ar It is perfect that you managed to resolve the problem. Please feel free to ask in case of any further issues. We are always happy to help you.

Installation Dependencies:

Linux Docker container : I was able to get my application up and running with aspose.words on linux container given the system dependencies.

Windows docker container: On a Python windows docker image I installed the .net core versions required, but I get an error as below duing application start up.

import aspose.words as aw

ImportError: DLL load failed while importing words: The specified module could not be found.

Do you have a dockerfile for windows container like the ones you have for Linux, if yes, can you direct me to the location, if no can you share a working version of a windows dockerfile.

Note: libssl1.1 is support has reached end of life in 2023, so I need to explore this in windows, Any help with the windows docker configuration for aspose.words pre-requisites is much appreciated.

Should this query be a new thread?

@sanjay.ar The problem might occur because you are using Windows Nano Server Docker container. Aspose.Words uses SkiaSharp to deal with graphics, which does not work on Windows Nano Server. Please try using Windows Core Server container instead.