Free Support Forum -

Saving .doc to .pdf on non windows platforms

Hi all,

I’ve trouble in exporting .doc files to .pdf on linux (ubuntu) / mac os x,

java.lang.IllegalStateException: Cannot find any fonts installed on the system.
at asposewobfuscated.pi.a(
at asposewobfuscated.pi.a(
at com.aspose.words.n.b(
at com.aspose.words.fp$b.C(
at com.aspose.words.fp$b.moveNext(
at com.aspose.words.fp.a(
at com.aspose.words.aof.Ud(
at com.aspose.words.aof.b(
at com.aspose.words.fp.(
at com.aspose.words.aqr.a(
at com.aspose.words.fq.ak(
at com.aspose.words.fq.Bl(
at com.aspose.words.fq.moveNext(
at com.aspose.words.fq.AH(
at com.aspose.words.vk.a(
at com.aspose.words.Document.updatePageLayout(
at com.aspose.words.Document.ab(
at com.aspose.words.Document.zy(
at com.aspose.words.Document.getPageCount(
at com.aspose.words.Document.a(

Any ideas?


Thanks for your request. When you render documents to PDF, XPS or convert to EPUB that requires embedding of fonts into a document, then Aspose.Words needs to have access to TrueType fonts. If you run Aspose.Words on a Windows system, then by default it will search for fonts in the system Windows\Fonts folder. But if you run Aspose.Words on a Linux system, it does not have a default location for fonts and you need to specify it explicitly.

Use the new com.aspose.words.FontSettings class and setFontsFolder/setFontsFolders methods to specify the location of TrueType fonts.


DocumentBuilder b = new DocumentBuilder();

b.getFont().setName("Water on the Oil");


b.writeln("Hello World!");

b.getDocument().save("TestHelloWorld Out.pdf");

Best regards,