yeokm1 / docs-to-pdf-converter

A standalone Java library/command line tool that converts DOC, DOCX, PPT, PPTX and ODT documents to PDF files.
MIT License
593 stars 244 forks source link

Exception #3

Open tetreum opened 9 years ago

tetreum commented 9 years ago
org.docx4j.openpackaging.exceptions.Docx4JException: Exception exporting package
    at org.docx4j.convert.out.common.AbstractExporter.export(AbstractExporter.java:96)
    at org.docx4j.Docx4J.toFO(Docx4J.java:467)
    at org.docx4j.Docx4J.toPDF(Docx4J.java:481)
    at     com.yeokhengmeng.docstopdfconverter.DocToPDFConverter.convert(DocToPDFConverter.java:33)
    at com.yeokhengmeng.docstopdfconverter.MainClass.main(MainClass.java:43)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:606)
    at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58)
Caused by: org.docx4j.openpackaging.exceptions.Docx4JException: Exception executing transformer: org.apache.fop.fo.ValidationException: The column-number or number of cells in the row overflows the number of fo:table-columns specified for the table. (See position 865:289)
    at org.docx4j.convert.out.fo.renderers.FORendererApacheFOP.render(FORendererApacheFOP.java:215)
    at org.docx4j.convert.out.fo.renderers.FORendererApacheFOP.render(FORendererApacheFOP.java:158)
    at org.docx4j.convert.out.fo.AbstractFOExporter.postprocess(AbstractFOExporter.java:139)
    at org.docx4j.convert.out.fo.AbstractFOExporter.postprocess(AbstractFOExporter.java:47)
    at org.docx4j.convert.out.common.AbstractExporter.export(AbstractExporter.java:81)
    ... 9 more
Caused by: javax.xml.transform.TransformerException: org.apache.fop.fo.ValidationException: The column-number or number of cells in the row overflows the number of fo:table-columns specified for the table. (See position 865:289)
    at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:502)
    at org.docx4j.convert.out.fo.renderers.FORendererApacheFOP.render(FORendererApacheFOP.java:211)
    ... 13 more
Caused by: org.apache.fop.fo.ValidationException: The column-number or number of cells in the row overflows the number of fo:table-columns specified for the table. (See position 865:289)
    at org.apache.fop.events.ValidationExceptionFactory.createException(ValidationExceptionFactory.java:38)
    at org.apache.fop.events.EventExceptionManager.throwException(EventExceptionManager.java:58)
    at org.apache.fop.events.DefaultEventBroadcaster$1.invoke(DefaultEventBroadcaster.java:175)
    at com.sun.proxy.$Proxy36.tooManyCells(Unknown Source)
    at org.apache.fop.fo.flow.table.TableCellContainer.addTableCellChild(TableCellContainer.java:75)
    at org.apache.fop.fo.flow.table.TableRow.addChildNode(TableRow.java:95)
    at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.startElement(FOTreeBuilder.java:313)
    at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:175)
    at org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1073)
    at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
    at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
    at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
    at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
    at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
    at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485)
    ... 14 more

Version: 1.8 I can provide the file (private) if needed.

yeokm1 commented 9 years ago

Alright, let me look into it. Can you send the file to my email at [removed]?

tetreum commented 9 years ago

Sent, you can delete your email from the comment.

chongtan08 commented 8 years ago

I'm also having the same problem, what is the solution for this?

chongtan08 commented 8 years ago

@tetreum have you solved the problem?

tetreum commented 8 years ago

The exception comes from one of the 3rd party library used in this project. You can't do anything, except to waiting for a fix.

chongtan08 commented 8 years ago

@tetreum Oh I see, did you do some workaround about this issue?

tetreum commented 8 years ago

Nope :( Before making a decision i looked for all current solutions, and the best working ones had a cheaper license of 8k€/year with page limitation or 2.5k€/year... Or they didn't just work in linux cli.

The problem here is that this is a "wrapper" so @yeokm1 can't fix the big issues, as they aren't in his code.

Also making a converter to work with all shitty proprietary formats is a big pain. So i understand there are no perfect solutions yet. If you find any, feel free to reply here.

chongtan08 commented 8 years ago

Ok thank you thank you. Have about you? Did you find any solution in converting the doc to pdf?

yeokm1 commented 8 years ago

Thanks for @tetreum for the replies. Like you said I can't find a solution to this problem either as I don't control the code in the libraries I use. I hope all of you will understand.

shusen007 commented 8 years ago

I have the same problem too. I tried both docx4j3.2.1 and 3.3.1.

shusen007 commented 8 years ago

I want this issue to be reopened otherwise I'll open another one.

yeokm1 commented 8 years ago

Hi @shusen007

I do not understand when you say you tried the different docx4j versions. Did you mean you recompiled my code with the different libraries? If the problems originate from the libraries, there is nothing I can do about it.

I can open the issue again but understand that I no longer have resources to maintain this project. However, I'm open to new pull requests and willing to do quick tests before merging it. I'm also open to have another co-maintainer of this project.

shusen007 commented 8 years ago

Thanks. My error log:

Hope someone can identify the problem.

org.docx4j.openpackaging.exceptions.Docx4JException: Exception exporting package at org.docx4j.convert.out.common.AbstractExporter.export(AbstractExporter.java:109) at org.docx4j.Docx4J.toFO(Docx4J.java:568) at org.docx4j.Docx4J.toPDF(Docx4J.java:583) at ........ at java.lang.Thread.run(Thread.java:745) Caused by: org.docx4j.openpackaging.exceptions.Docx4JException: Cannot perform the transformation at org.docx4j.XmlUtils.transform(XmlUtils.java:1277) at org.docx4j.XmlUtils.transform(XmlUtils.java:1100) at org.docx4j.convert.out.common.AbstractXsltExporterDelegate.process(AbstractXsltExporterDelegate.java:66) at org.docx4j.convert.out.common.AbstractWmlExporter.process(AbstractWmlExporter.java:63) at org.docx4j.convert.out.common.AbstractWmlExporter.process(AbstractWmlExporter.java:32) at org.docx4j.convert.out.common.AbstractExporter.export(AbstractExporter.java:79) ... 91 more Caused by: javax.xml.transform.TransformerException: java.lang.NullPointerException at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2416) at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2281) at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1367) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:709) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1284) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1262) at org.docx4j.XmlUtils.transform(XmlUtils.java:1275) ... 96 more Caused by: java.lang.NullPointerException at org.apache.xalan.templates.ElemVariable.getValue(ElemVariable.java:280) at org.apache.xalan.templates.ElemVariable.execute(ElemVariable.java:246) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:393) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:176) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2411) ... 102 more

tobeorla commented 8 years ago

@yeokm1 if i were you, i wouldn't have reopened this issue. Check @shusen007's profile, he is the sort of selfish user that only wants to things to get fixed for him, he didn't make any contribution to open source community. He just expects you to fix the problem. If he opens another issue, just block him from the repo ;)

yeokm1 commented 8 years ago

@tobeorla Thanks for the advice! I'm fine with the issue being open although I have no means of solving them.

I have added a note at the top of README.md so people can understand the situation behind this project.

izhangzhihao commented 8 years ago

I have been tortured for too long /(ㄒoㄒ)/~~

shusen007 commented 8 years ago

I end up use Linux command line lowriter --headless --convert-to pdf fileNmae.docx to do the job for me.