Cannot make groupdocs conversion library work

I’m trying to convert excel file to pdf file.
I’m using GroupDocs.Conversion java library v24.8, on Ubuntu 22.04.4 LTS 64-bit.
I keep getting an error: com.groupdocs.conversion.internal.c.a.pd.exceptions.FontNotFoundException: Font Arial was not found

Maven:

<dependency>
    <groupId>com.groupdocs</groupId>
    <artifactId>groupdocs-conversion</artifactId>
    <version>24.8</version>
</dependency>

The code:

Converter converter = new Converter("originalFile.xlsx");
PdfConvertOptions options = new PdfConvertOptions();
converter.convert("convertedFile.pdf", options);

Even if I add this before conversion:

try {
    Font originalFont = FontRepository.findFont("Arial");
} catch (FontNotFoundException e) {
    FontRepository.getSubstitutions().add(new SimpleFontSubstitution("Arial", "Helvetica"));
}

I’m still getting the same error, cannot find font Arial, even though font substitution passed well.

Have you considered this? How To Install Windows Fonts on Ubuntu | Documentation

Thanks for the answer.

I’m not sure if this is acceptable solution for us, cause we don’t have full control over servers where our web app would be deployed.

Is this some known issue for GroupDocs.Conversion on Ubuntu?
Is there a way to bundle fonts into the GroupDocs.Conversion java library, or to make a new dependency that’d be pulled by GroupDocs.Conversion?

Regards,
Vedran

@vmimic you can create and specify a font folder

I have tried

ConverterSettings converterSettings = new ConverterSettings();
converterSettings.setFontDirectories(List.of("/usr/share/fonts", "/usr/share/fonts/truetype", "/usr/share/fonts/truetype/dejavu"));
Converter converter = new Converter(inputPath, converterSettings)

and I’m still getting the same error: Font Arial was not found

Even if I try substitution:
FontRepository.getSubstitutions().add(new SimpleFontSubstitution("Arial", "Lato"));
the substitution itself does not throw an error, but the conversion later throws still the same error: Font Arial was not found

P.S.
I don’t use any licence, paid or temporary.

Thank you for feedback @vmimic , I will check it and update you

Also, how is it possible that GroupDocs.Viewer can convert DOC to PDF successfully, but GroupDocs.Conversion, a library that’s actually intended for conversion, fails to do the same?

@vmimic

While both libs share some common modules the code bases are different, so the errors may vary.