How to set fonts folder?

Using our licensed Aspose PDF 10.8.0, how would you set the font sources so that htmlToPdf conversion knows where to look if we have fonts specified in our CSS?

We do set the fonts when the App is being build with aspose Words using:
FontSettings.setFontsFolder(folder.absolutePath,true)

Will “setFontsFolder” from aspose words have any impact when doing htmlToPdf conversion?

Thanks

@petarr

Thank you for contacting support.

You are using quite old and outdated version of the API whereas, support is provided based on latest available version. We always recommend latest versions because they include more features and bug fixes.

Moreover, you may specify the custom font directory and add a folder in font folder lists as follows:

[Java]

String path = "path/to/my/folder";
List<String> fontPaths = com.aspose.pdf.Document.getLocalFontPaths();
fontPaths.add(path);
com.aspose.pdf.Document.setLocalFontPaths(fontPaths);

Thanks @Farhan.Raza

I’ll give that a shot.
We will consider an upgrade.

@Farhan.Raza

Last question: How do you verify which Font is being used currently by the Pdf document?

@petarr

Any font can be set with setFont method as explained in Add Text to a PDF file but we are afraid a list of all fonts in use may not be available while working with a Document.