Hello,
I'm trying to convert a docx file to pdf but it is not working. The document has text and images.
The command I'm using is:
- Code: Select all
java -cp docx4j-2.8.1.jar:log4j-1.2.15.jar:xmlgraphics-commons-1.4.jar:commons-logging-1.1.1.jar:xalan-2.7.1.jar:fop-1.0.jar:commons-io-1.3.1.jar:serializer-2.7.1.jar:avalon-framework-impl-4.3.1.jar:avalon-framework-api-4.3.1.jar org.docx4j.samples.ConvertOutPDF myfile.docx
and the error I get is:
Exception in thread "main" org.docx4j.openpackaging.exceptions.Docx4JException: FOP issues
at org.docx4j.convert.out.pdf.viaXSLFO.Conversion.output(Conversion.java:374)
at org.docx4j.samples.ConvertOutPDF.main(ConvertOutPDF.java:138)
Caused by: javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: For "fo:root", "fo:layout-master-set" must be declared before "fo:page-sequence"! (See position 1:168)
at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:502)
at org.docx4j.convert.out.pdf.viaXSLFO.Conversion.output(Conversion.java:362)
... 1 more
Caused by: org.apache.fop.fo.ValidationException: For "fo:root", ...