Page 1 of 1

org.docx4j.Docx4J not found

PostPosted: Wed Aug 21, 2013 3:34 am
by far
Using IntelliJ. Added Jars to project but the following imports are not found. What am I missing? Items in bold are NOT FOUND even though Jars are included and the rest of org.docx4j references are ok e.g. import org.docx4j.fonts.Mapper;, import org.docx4j.samples.AbstractSample; etc.


import org.docx4j.Docx4J;
import org.docx4j.convert.out.FOSettings;
import org.docx4j.fonts.IdentityPlusMapper;
import org.docx4j.fonts.Mapper;
import org.docx4j.fonts.PhysicalFont;
import org.docx4j.fonts.PhysicalFonts;
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
import org.docx4j.samples.AbstractSample;

/**
* Demo of PDF output.
*
* PDF output is via XSL FO.
* First XSL FO is created, then FOP
* is used to convert that to PDF.
........

in addition these lines can not compile. Items in bold have dependency on imports that are not found. Strange!

SampleDocument.createContent(wordMLPackage.getMainDocumentPart());

FOSettings foSettings = Docx4J.createFOSettings();

Re: org.docx4j.Docx4J not found

PostPosted: Wed Aug 21, 2013 8:18 am
by far
why aren't these two imports recognized. The JARS are on the class path and part of the project as are a hundred other libraries without issue.

mport org.docx4j.Docx4J;
import org.docx4j.convert.out.FOSettings;

Nether are found. Have the packages chafed? This is from the converrt2PDf example

Re: org.docx4j.Docx4J not found

PostPosted: Wed Aug 21, 2013 9:12 am
by jason
If you have copied that sample code from GitHub and are attempting to use it with a docx4j jar, you'll need the latest nightly:

http://www.docx4java.org/docx4j/docx4j- ... 130821.jar

Otherwise, if you are using docx4j source code, those are new classes, and they are where they should be:

https://github.com/plutext/docx4j/blob/ ... ocx4J.java

https://github.com/plutext/docx4j/blob/ ... tings.java

Possibly you haven't pulled the latest code properly?

If you want to use an older version of docx4j, look at prior revisions of the PDF sample to see how it used to work.

Re: org.docx4j.Docx4J not found

PostPosted: Wed Aug 21, 2013 9:29 am
by far
Thanks Jason, todays nightly build JAR worked.

Much appreciated.