Page 1 of 1

Unable to use fonts

PostPosted: Wed Aug 12, 2015 5:24 pm
by sushmita
I am running an ASP.Net website with doc to pdf conversion capability. It is on a shared web server.

I get this error "No dir configured for temp fonts! Either set system property user.home to a writable dir, or configure docx4j property 'docx4j.openpackaging.parts.WordprocessingML.ObfuscatedFontPart.tmpFontDir'" though Write permissions have been given to the virtual directory.

Is there any way I can change the path the obfuscated temporary fonts are saved?

Re: Unable to use fonts

PostPosted: Thu Aug 13, 2015 12:22 pm
by jason
set the property "docx4j.openpackaging.parts.WordprocessingML.ObfuscatedFontPart.tmpFontDir" in Docx4j.properties file added to your classpath.

Re: Unable to use fonts

PostPosted: Thu Aug 13, 2015 3:53 pm
by sushmita
Hello Jason, thank you for the quick response.

I tried setting the property 'tempFontDir' to the virtual directory. However it is not working.
This site is on a shared server and TomCat (or other similar servelet) is not enabled.

Here is the link: http://conferencevisa.elseviermarketing ... o=74tyT4Ab

Code:
string projectDir = System.IO.Directory.GetParent(System.IO.Directory.GetParent(Environment.CurrentDirectory.ToString()).ToString()).ToString() + "\\";
org.docx4j.openpackaging.packages.WordprocessingMLPackage wordMLPackage = org.docx4j.openpackaging.packages.WordprocessingMLPackage.load(strJavaFile_Input);
java.io.FileOutputStream fos = new java.io.FileOutputStream(strJavaFile_Output);

org.docx4j.Docx4jProperties.setProperty("org.docx4j.openpackaging.parts.WordprocessingML.ObfuscatedFontPart.tmpFontDir", projectDir);