Page 1 of 1

Docx4j .net issue

PostPosted: Fri May 27, 2016 3:12 am
by keneda
Hello,

I am trying to use docx4j for .net to convert a docx file into a pdf. Whenever I try running the conversion I get the following error:

Exception loading default template "org/docx4j/convert/out/fo/docx2fo.xslt", org/docx4j/convert/out/fo/docx2fo.xslt not found via classloader.

My code is pulled almost directly from the DoxctoPDF example included with the package:

string fileIN = @"completefilepathandname";
string fileOUT = @"completefilepathandname";

Plutext.PropertiesConfigurator.setDocx4jPropertiesDir(@"completefilepath");

// OK, do it..
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage
.load(new java.io.File(fileIN));

java.io.FileOutputStream fos = new FileOutputStream(fileOUT);

Docx4J.toPDF(wordMLPackage, fos);

fos.close();


I am using a simple docx document with only two lines of text to try and test this. Is there something I am missing?

Thank you

Re: Docx4j .net issue

PostPosted: Fri Sep 23, 2016 12:50 am
by David.Synott
Hi. Did you resolve this? I have exactly the same issue. I cut an past the code into a .NET class library and it fails.