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

NullPointerException occurs while converting odt to pdf. #12

Open ISKU opened 7 years ago

ISKU commented 7 years ago

hi I have encountered the following error using docs-to-pdf-converter.

Loading stream
Load completed in 457ms, now converting...
org.odftoolkit.odfdom.converter.core.ODFConverterException: java.lang.NullPointerException
    at org.odftoolkit.odfdom.converter.pdf.PdfConverter.doConvert(PdfConverter.java:82)
    at org.odftoolkit.odfdom.converter.pdf.PdfConverter.doConvert(PdfConverter.java:43)
    at org.odftoolkit.odfdom.converter.core.AbstractODFConverter.convert(AbstractODFConverter.java:42)
    at com.yeokhengmeng.docstopdfconverter.OdtToPDF.convert(OdtToPDF.java:29)
    at com.yeokhengmeng.docstopdfconverter.MainClass.main(MainClass.java:43)
Caused by: java.lang.NullPointerException
    at org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.createAndAddChunk(ElementVisitorForIText.java:787)
    at org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.processTextNode(ElementVisitorForIText.java:772)
    at org.odftoolkit.odfdom.converter.core.ElementVisitorConverter.visit(ElementVisitorConverter.java:85)
    at org.odftoolkit.odfdom.dom.DefaultElementVisitor.visit(DefaultElementVisitor.java:2541)
    at org.odftoolkit.odfdom.dom.element.office.OfficeMasterStylesElement.accept(OfficeMasterStylesElement.java:109)
    at org.odftoolkit.odfdom.converter.pdf.PdfConverter.processBody(PdfConverter.java:122)
    at org.odftoolkit.odfdom.converter.pdf.PdfConverter.doConvert(PdfConverter.java:65)
    ... 4 more

I used IntelliJ IDEA. In the MainClass class, I ran it by typing the "-i test.odt -o test.pdf -t odt" arguments.

yeokm1 commented 7 years ago

Hi as stated in the description

"I'm not maintaining this code as I neither have personal resources nor am I still using this project. I'll be happy to oblige if you have any pull requests or even if you wish to be a co-maintainer."

Hope you can understand thanks!