Thanks for contacting support.
Adding more to Imran’s comments, the information/steps shared are related to setting font when manipulating text inside existing PDF document. However when performing PDF to PDF/A conversion on non-Windows platform, the API searches fonts which need to be embedded in PDFA file and in current circumstances, it seems Aspose.Pdf for Java is unable to find fonts on your system. Please note on non-Windows OS, Aspose.Pdf for Java looks fonts in system default font path or specified local font path for custom font directory.
Please note most of the PDF documents that we convert are created by people using Windows or Mac OS operating systems with fonts that are installed with Microsoft Windows or with Microsoft Office. To resolve your issue either you can install Microsoft fonts on your system or copy fonts from your windows OS and paste to your system default font path.
Furthermore, if you want to use custom fonts from other than system default font path then you need to add that folder path into LocalFontPath as following. You can use following methods to get system folder of fonts or set font path to font folders.
- Document.getLocalFontPath () - shows the system folder in which project will look for fonts.
- Document.setLocalFontPath (String) - Setting font path to custom folder
// Set font folder path
String path = “/home/tilal/fonts/”;
// Adding a single font directory
// setting the user list for standard font directories
java.util.List list = com.aspose.pdf.Document.getLocalFontPaths();
We are sorry for the inconvenience caused.