When trying to save to a “.doc” or “.docx” or “.odt” it works fine. But as soon as I try to save to “.pdf” it fails with “Fail: unknown method name `to_str’”.
Hello
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.
FontSettings.setFontsFolder("C:\\Users\\Andrey\\IdeaProjects\\awtest");
DocumentBuilder b = new DocumentBuilder();
b.getFont().setName("Water on the Oil");
b.getFont().setSize(72);
b.writeln("Hello World!");
b.getDocument().save("TestHelloWorld Out.pdf");