Cannot find any fonts installed on the system (MacOS)

Hello there, I’m trying to run a small piece of code that converts PDF to DOCX. I get an InvalidOperationException with a message says “Cannot find any fonts installed on the system”. Here’s my environment:

OS: MacOS Mojave
DotNet core: 2.1.505

Here’s the code I’m running:

            Aspose.Pdf.Text.FontRepository.Sources.Clear();
            Aspose.Pdf.Text.FontSource pdfFontSource = new 
            Aspose.Pdf.Text.FolderFontSource("/Users/fawaz/fonts");
            Aspose.Pdf.Text.FontRepository.Sources.Add(pdfFontSource);
            Document pdf = new Document("/Users/fawaz/Sample.pdf");
            pdf.Save("/Users/fawaz/output.docx", SaveFormat.DocX);

Thank you for reading this!

@fawaz9

Thank you for contacting support.

Would you please ensure that fonts being used in your source file and ms truetype fonts are installed in your environment as you may notice in other forum threads that the issue usually gets resolved with installation of fonts. Make sure that you are using Aspose.PDF for .NET 19.3 in your environment. If you still face the issue then please share your source file along with complete stack trace so that we may investigate further to help you out.