FontDirExc property

Hello,



in this post “Conversion produces different PDF on different platform” a new property has been introduced for the folder where Aspose.Cells searches for fonts.



Is there something similar for other components of Aspose.Total? In particular, I need a similar mechanism for Aspose.Words, but it would be useful to have it for other components as well.

Hi Mario,


Thanks for contacting support.

Aspose.Words for Java supports the feature to set custom font folder where fonts can be found/located during document creation/manipulation with Aspose.Words for Java. For further details, please visit How to Specify True Type Fonts Location.

Aspose.Pdf for Java also supports the feature to specify custom fonts directory where fonts will be located during PDF creation and manipulation. You can use following methods to get system folder of fonts or set font path to font folders. Hopefully it will help you to fix the issue.

Document.getLocalFontPath () // shows the system folder in which project will
look for fonts.
<o:p></o:p>

Document.setLocalFontPath (String) // Setting font path to custom folder

//adding a new font path

String path = "c:\\fonts\\";

com.aspose.pdf.Document.addLocalFontPath(path);

The following code snippet to set font path if there are more than one font path.


//geting the list for standard font directories in different OS

java.util.List list = com.aspose.pdf.Document.getLocalFontPaths();

//seting the user list for standard font directories

list.add("c:\\fonts2\\");

list.add("c:\\fonts3\\");

com.aspose.pdf.Document.setLocalFontPaths(list);

//Restoring list for standard font directories by default.

com.aspose.pdf.Document.restoreLocalFontPath();

Hello,



sorry for answering only now, I was busy on other tasks.



Your suggestion seems to work satisfactorily.



Thanks!

Hi Mario,


We are glad to hear that your problem is resolved. Please continue using our API and in the event of any further query, please feel free to contact.