Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri Apr 14, 2023 5:17 pm

Hi,
I'm developing a Java Project with Spire.PDF for JAVA, and trying to use it in a Windows and also in a LINUX Environment.
I've a question about "setCustomFontsFolders" :

PdfDocument.setCustomFontsFolders("/usr/share/fonts/truetype/msttcorefonts");

If the path is not found, te method not return exception, but it seems to search into OS fonts default folder.
In input I should to pass the absolute path or relative path of fonts folder?

Best regards,
Filippo

filippo.gatto
 
Posts: 11
Joined: Fri Feb 24, 2023 3:08 pm

Mon Apr 17, 2023 9:10 am

Hi,

Thank you for your inquiry.

The current processing logic of PdfDocument.setCustomFontsFolders() method in our Spire.PDF for Java is that if the program code internally determines that the input folder doesn't exist, it will be ignored without throwing an exception and then the local default fonts will be used. Therefore, no exception will be thrown if there is no corresponding folder. When setting the path of a private font folder, you can input either the relative or absolute path of the folder.

If you have any further questions, please feel free to contact us. We'd be happy to help you.

Sincerely,
Ella
E-iceblue support team
User avatar

Ella.Zhang
 
Posts: 42
Joined: Fri Apr 07, 2023 7:42 am

Return to Spire.PDF

cron