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

OutOfMemory #5

Closed tobeorla closed 8 years ago

tobeorla commented 8 years ago

Thanks for creating this converter!

On some files i get this:

Exception in thread "main" java.lang.reflect.InvocationTargetException 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: java.lang.OutOfMemoryError: Java heap space at java.lang.String.substring(String.java:1913) at org.apache.xmlbeans.impl.store.Locale.makeQualifiedQName(Locale.java:1620) at org.apache.xmlbeans.impl.store.Locale$SaxHandler.startElement(Locale.java:3211) at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.reportStartTag(Piccolo.java:1082) at org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.parseAttributesNS(PiccoloLexer.java:1822) at org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.parseOpenTagNS(PiccoloLexer.java:1521) at org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.parseTagNS(PiccoloLexer.java:1362) at org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.parseXMLNS(PiccoloLexer.java:1293) at org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.parseXML(PiccoloLexer.java:1261) at org.apache.xmlbeans.impl.piccolo.xml.PiccoloLexer.yylex(PiccoloLexer.java:4812) at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.yylex(Piccolo.java:1290) at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.yyparse(Piccolo.java:1400) at org.apache.xmlbeans.impl.piccolo.xml.Piccolo.parse(Piccolo.java:714) at org.apache.xmlbeans.impl.store.Locale$SaxLoader.load(Locale.java:3479) at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1277) at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:1264) at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:345) at org.openxmlformats.schemas.wordprocessingml.x2006.main.DocumentDocument$Factory.parse(Unknown Source) at org.apache.poi.xwpf.usermodel.XWPFDocument.onDocumentRead(XWPFDocument.java:136) at org.apache.poi.POIXMLDocument.load(POIXMLDocument.java:166) at org.apache.poi.xwpf.usermodel.XWPFDocument.(XWPFDocument.java:125) at com.yeokhengmeng.docstopdfconverter.DocxToPDFConverter.convert(DocxToPDFConverter.java:22) at com.yeokhengmeng.docstopdfconverter.MainClass.main(MainClass.java:43) ... 5 more

And i do also receive this one:

org.odftoolkit.odfdom.converter.core.ODFConverterException: java.lang.ClassCastException: Insertion of illegal Element: 12 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) 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: java.lang.ClassCastException: Insertion of illegal Element: 12 at com.lowagie.text.Phrase.add(Unknown Source) at fr.opensagres.xdocreport.itext.extension.ExtendedParagraph.addElement(ExtendedParagraph.java:63) at org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.addITextContainer(ElementVisitorForIText.java:829) at org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.addITextContainer(ElementVisitorForIText.java:817) at org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.processParagraphOrHeading(ElementVisitorForIText.java:382) at org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.visit(ElementVisitorForIText.java:320) at org.odftoolkit.odfdom.dom.element.text.TextPElement.accept(TextPElement.java:1681) at org.odftoolkit.odfdom.converter.core.ElementVisitorConverter.visit(ElementVisitorConverter.java:82) at org.odftoolkit.odfdom.dom.DefaultElementVisitor.visit(DefaultElementVisitor.java:1757) at org.odftoolkit.odfdom.dom.element.draw.DrawPathElement.accept(DrawPathElement.java:401) at org.odftoolkit.odfdom.converter.core.ElementVisitorConverter.visit(ElementVisitorConverter.java:82) at org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.addITextContainer(ElementVisitorForIText.java:826) at org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.addITextContainer(ElementVisitorForIText.java:817) at org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.processParagraphOrHeading(ElementVisitorForIText.java:382) at org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.visit(ElementVisitorForIText.java:320) at org.odftoolkit.odfdom.dom.element.text.TextPElement.accept(TextPElement.java:1681) at org.odftoolkit.odfdom.converter.core.ElementVisitorConverter.visit(ElementVisitorConverter.java:82) at org.odftoolkit.odfdom.dom.DefaultElementVisitor.visit(DefaultElementVisitor.java:2605) at org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.visit(ElementVisitorForIText.java:253) at org.odftoolkit.odfdom.dom.element.office.OfficeTextElement.accept(OfficeTextElement.java:805) at org.odftoolkit.odfdom.converter.pdf.PdfConverter.processBody(PdfConverter.java:126) at org.odftoolkit.odfdom.converter.pdf.PdfConverter.doConvert(PdfConverter.java:65) ... 9 more

And another one:

org.apache.poi.xwpf.converter.core.XWPFConverterException: java.lang.NullPointerException at org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:70) at org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:38) at org.apache.poi.xwpf.converter.core.AbstractXWPFConverter.convert(AbstractXWPFConverter.java:45) at com.yeokhengmeng.docstopdfconverter.DocxToPDFConverter.convert(DocxToPDFConverter.java:28) 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: java.lang.NullPointerException at org.apache.poi.xwpf.converter.core.styles.run.RunUnderlineValueProvider.getValue(RunUnderlineValueProvider.java:40) at org.apache.poi.xwpf.converter.core.styles.run.RunUnderlineValueProvider.getValue(RunUnderlineValueProvider.java:31) at org.apache.poi.xwpf.converter.core.styles.run.AbstractRunValueProvider.getValueFromElement(AbstractRunValueProvider.java:76) at org.apache.poi.xwpf.converter.core.styles.run.AbstractRunValueProvider.getValueFromElement(AbstractRunValueProvider.java:44) at org.apache.poi.xwpf.converter.core.styles.AbstractValueProvider.internalGetValue(AbstractValueProvider.java:50) at org.apache.poi.xwpf.converter.core.styles.AbstractValueProvider.getValue(AbstractValueProvider.java:41) at org.apache.poi.xwpf.converter.core.styles.XWPFStylesDocument.getUnderline(XWPFStylesDocument.java:692) at org.apache.poi.xwpf.converter.pdf.internal.PdfMapper.visitRun(PdfMapper.java:475) at org.apache.poi.xwpf.converter.pdf.internal.PdfMapper.visitRun(PdfMapper.java:111) at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.visitRuns(XWPFDocumentVisitor.java:616) at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.visitParagraphBody(XWPFDocumentVisitor.java:441) at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.visitParagraph(XWPFDocumentVisitor.java:332) at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.visitBodyElements(XWPFDocumentVisitor.java:247) at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.start(XWPFDocumentVisitor.java:199) at org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:56) ... 9 more

I don't know if it will help you in some way.

yeokm1 commented 8 years ago

I'm sorry haha. I don't think I can help much. The issue is with the libraries I'm using which I have no control ever. I'll update the libraries to the latest versions once my free time permits.

tobeorla commented 8 years ago

Ok, ty, closing issue