We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Pdf java.lang.IllegalStateException: Font 'Times New Roman' not found. Please make sure the customer font file is correctly set

Hi,


I needs support for Mac Osx (OS X 10.9.5)

In attachment few lines of code that produce the exception.
I tried to use both
aspose-pdf-4.5.1-jdk16.jar (licensed)
aspose-pdf-9.5.0-jdk16.jar (not covered by the actual license)

in any case the result is the exception at the end of this message.

I already try different tips coming from others threads of this forum
(I commented this tries on the PdfTest.java inside the attachment)
like:
-Daspose.pdf.fontpath=/Library/Fonts
-Daspose.pdf.fontpath=./fonts/

Document.addLocalFontPath("/Library/Fonts");
pdf.setTruetypeFontMapPath("/Library/Fonts");
pdf.getTextInfo().setTruetypeFontFileName("/Library/Fonts/Times New Roman.ttf");

For helping you in the debug, here the result of

System.out.println(Document.getLocalFontPaths());

[/usr/X11R6/lib/X11/fonts, C:\WINDOWS\Fonts, /usr/openwin/lib/X11/fonts/TrueType/, /usr/openwin/lib/X11/fonts/, /usr/share/fonts/truetype/, /usr/local/share/fonts/, $home/.fonts/, /usr/share/fonts/truetype/, /usr/X11R6/lib/X11/fonts/ttfonts/, /usr/X11R6/lib/X11/fonts/, /Library/Fonts/, ~/Library/Fonts/, /Network/Library/Fonts/, /System/Library/Fonts/, ~/.fonts/, /usr/share/fonts/liberation/, /system/fonts/]


I have tries also to run the code by root for avoid issues on the permissions.
Nothing changed.

PS.
The PdfTest.java requires also apache-common-io to run. I didn’t attach it.

Exception in thread “main” java.lang.IllegalStateException: Font ‘Times New Roman’ not found. Please make sure the customer font file is correctly set.
at internal.hv.a(Unknown Source)
at internal.ht.c(Unknown Source)
at internal.ht.a(Unknown Source)
at internal.io.a(Unknown Source)
at internal.io.a(Unknown Source)
at internal.kp.a(Unknown Source)
at internal.ll.a(Unknown Source)
at internal.la.a(Unknown Source)
at aspose.pdf.xml.DocumentBase.a(Unknown Source)
at internal.ka.a(Unknown Source)
at aspose.pdf.Pdf.b(Unknown Source)
at aspose.pdf.Pdf.save(Unknown Source)

Hi Simone,


We are sorry for the inconvenience caused. We are looking into it and will update you soon.

Best Regards,