Docx to pdf output differs when running in different environment, how we can set the font while converting it

We are converting docx to pdf as per the below code. When we convert from one system, pdf texts are coming with different text, while we convert pdf in another system or environment, it is coming with different font and size even through we are not explicitly setting the fonts. Why there is so much different in pdf output formattings? Is there a way to set a standarized font so that we wont end up in the variation of different document output.

String convertedFile = “template.pdf”;
com.groupdocs.conversion.Converter converter = new com.groupdocs.conversion.Converter(tempFile.getAbsolutePath());
com.groupdocs.conversion.options.convert.PdfConvertOptions options = new com.groupdocs.conversion.options.convert.PdfConvertOptions();
converter.convert(convertedFile, options);
DLP-4436-223QUOTE19 (1).pdf (1.4 MB)

Attached both the files for reference

DLP-4436-223QUOTE 1 (1).pdf (1.4 MB)
Attached the docx file also.
Core Details 1.docx (956.0 KB)

Hi suhail.thusu
Can you please attach a sample docx?

attached the files

@suhail.thusu
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): CONVERSIONJAVA-2361

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@suhail.thusu can you please attach original DOCX file?

attached docx file

The source DOCX file uses the Calibri font. If the GroupDocs Conversion can’t find a font used in a source document installed in the host OS, it replaces it by the Arial font by default.
So you should install to your OS (or container) all fonts which may be present in the source documents.

can we explicitly specify the font name in the Conversion object?

@suhail.thusu sure
Please see this article
You can specify the default font or setup font substitutions.
In every case you should check if font you specified is installed on the host OS.

Calibri font is not available in linux based machines…so how can we handle this issue? These fonts are need to be taken care by conversion tool, looks like it is not happening… can you suggest the work around on this?

You can install Windows fonts on Linux, including Calibri.

To install Windows fonts using apt-get utility open terminal and type:

  1. sudo apt-get update - Pull the lates updates.
  2. sudo apt-get install ttf-mscorefonts-installer - Install Windows fonts.
  3. sudo apt-get install fontconfig - Install fontconfig library and fc-cache utility.
  4. sudo fc-cache -f -v - Build fonts cache.

For rpm based Linux you can see this link.