I just requested a temp license to test newest version, which I just downloaded.
When re-compiling the java code, I get an error saying that
non-static method setFontsFolder(java.lang.String,boolean) cannot be referenced from a static context
how is the FontSettings class supposed to be used now?
Hi Matteo,
public static void DOCtoPDF() throws Exception{<o:p></o:p>
FontSettings.getDefaultInstance().setFontsFolder("/home/tilal/Fonts", true);
com.aspose.words.Document docx = new com.aspose.words.Document(“sample.doc”);<o:p></o:p>
docx.save(“sample.pdf”);<o:p></o:p>
}
The previously working code is as simple as:
FontSettings.setFontsFolder(’/my/fonts/folder’, true);
but it seems that setFontsFolder is no longer a static method, now is an instance method.
Hi Matteo,
com.aspose.words.Document docx = new
com.aspose.words.Document(“sample.doc”);<o:p></o:p>
FontSettings fontsetting= new FontSettings();
fontsetting.setFontsFolder("/home/tilal/Fonts", true);
....
Hi,
perhaps I didn’t phrase my issue correctly.
The problem is NOT using the setFontsFolder in a static method; but rather that setFontsFolder used to be a static method itself, to be called like FontSettings.setFontsFolder(…), while now it has become an instance method, and I do not understand how should it be used now.
Hi Matteo,
FontSettings.getDefaultInstance().setFontsFolder("/home/tilal/Fonts", true);