bellakhalAmir / xdocreport

Automatically exported from code.google.com/p/xdocreport
0 stars 0 forks source link

fr.opensagres.xdocreport.converter.XDocConverterException: org.apache.poi.xwpf.converter.core.XWPFConverterException: java.lang.NullPointerException while converting docx to pdf #486

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
PDF generation

What is the expected output? What do you see instead?
PDF document. NullPointerException.

What version of the product are you using? On what operating system?
1.0.5. Linux

Please provide any additional information below.
Attached document questions.docx (having Header, Footer Tables and lot of 
Paragraphs) contains exam questions. Conversion of this docx results in 
NullPointerException (see below). However, when removing Header and footer, the 
conversion will be successful. I am using xDocReport libs in production 
envirnment (letspractice.in) for docx generation. 

Best regards,
Adeel Ahmad

fr.opensagres.xdocreport.converter.XDocConverterException: 
org.apache.poi.xwpf.converter.core.XWPFConverterException: 
java.lang.NullPointerException
    at fr.opensagres.xdocreport.converter.docx.poi.itext.XWPF2PDFViaITextConverter.convert(XWPF2PDFViaITextConverter.java:72)
    at DocToPdfUsingXdocReport.convertToPdf(DocToPdfUsingXdocReport.java:43)
    at DocToPdfUsingXdocReport.main(DocToPdfUsingXdocReport.java:19)
Caused by: 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 fr.opensagres.xdocreport.converter.docx.poi.itext.XWPF2PDFViaITextConverter.convert(XWPF2PDFViaITextConverter.java:67)
    ... 2 more
Caused by: java.lang.NullPointerException
    at org.apache.poi.xwpf.converter.core.utils.XWPFTableUtil.getWidth(XWPFTableUtil.java:273)
    at org.apache.poi.xwpf.converter.core.utils.XWPFTableUtil.computeColWidths(XWPFTableUtil.java:284)
    at org.apache.poi.xwpf.converter.core.utils.XWPFTableUtil.computeColWidths(XWPFTableUtil.java:127)
    at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.visitTable(XWPFDocumentVisitor.java:867)
    at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.visitBodyElements(XWPFDocumentVisitor.java:251)
    at org.apache.poi.xwpf.converter.pdf.internal.PdfMapper.visitHeader(PdfMapper.java:185)
    at org.apache.poi.xwpf.converter.pdf.internal.PdfMapper.visitHeader(PdfMapper.java:111)
    at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.visitHeaderRef(XWPFDocumentVisitor.java:1137)
    at org.apache.poi.xwpf.converter.core.MasterPageManager.visitHeadersFooters(MasterPageManager.java:213)
    at org.apache.poi.xwpf.converter.core.MasterPageManager.addSection(MasterPageManager.java:180)
    at org.apache.poi.xwpf.converter.core.MasterPageManager.compute(MasterPageManager.java:127)
    at org.apache.poi.xwpf.converter.core.MasterPageManager.initialize(MasterPageManager.java:90)
    at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.visitBodyElements(XWPFDocumentVisitor.java:232)
    at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.start(XWPFDocumentVisitor.java:199)
    at org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:56)
    ... 5 more

Original issue reported on code.google.com by adzeead...@gmail.com on 29 Jun 2015 at 10:00

Attachments: