danishiumca / xdocreport

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

POI ERROR: Expecting one Styles document part, but found 0 #466

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. I have a word document, after
2. With POI I replace some text with other text and as specific tag for an 
image, after
3. is generate a word document with new text and image
4. but when I convert the document to pdf type i got error:
org.apache.poi.xwpf.converter.core.XWPFConverterException: 
java.lang.IllegalStateException: Expecting one Styles document part, but found 0
    at org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:59)
    at org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:37)
    at org.apache.poi.xwpf.converter.core.AbstractXWPFConverter.convert(AbstractXWPFConverter.java:45)
    at poi38.ooxmlToPDF.createPDF(ooxmlToPDF.java:53)
    at poi38.ooxmlToPDF.main(ooxmlToPDF.java:18)
Caused by: java.lang.IllegalStateException: Expecting one Styles document part, 
but found 0
    at org.apache.poi.xwpf.usermodel.XWPFDocument.getStyle(XWPFDocument.java:441)
    at org.apache.poi.xwpf.converter.core.styles.XWPFStylesDocument.<init>(XWPFStylesDocument.java:192)
    at org.apache.poi.xwpf.converter.core.styles.XWPFStylesDocument.<init>(XWPFStylesDocument.java:186)
    at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.createStylesDocument(XWPFDocumentVisitor.java:161)
    at org.apache.poi.xwpf.converter.core.XWPFDocumentVisitor.<init>(XWPFDocumentVisitor.java:154)
    at org.apache.poi.xwpf.converter.pdf.internal.PdfMapper.<init>(PdfMapper.java:149)
    at org.apache.poi.xwpf.converter.pdf.PdfConverter.doConvert(PdfConverter.java:54)
    ... 4 more
Process exited with exit code 0.

What is the expected output? What do you see instead?
 - A pdf file

What version of the product are you using? On what operating system?
  - POI 3.8, xdocreport-1.0.4.jar, itext2.1.7.jar

Please provide any additional information below.

Although POI is modifying doc, I think that process poi is adding some wrong, 
because I try convert to PDF i catch error.
If I open the document with microsoft office and remove image and insert the 
same image and save, after the process run fine.

Original issue reported on code.google.com by rramos0...@gmail.com on 23 Feb 2015 at 7:56

GoogleCodeExporter commented 9 years ago
Please your kind help.

Original comment by rramos0...@gmail.com on 23 Feb 2015 at 7:57

GoogleCodeExporter commented 9 years ago
Hello!
I have the same problem.
Did you solve it?

Original comment by natape...@gmail.com on 1 May 2015 at 6:28

GoogleCodeExporter commented 9 years ago
It's a problem with POI, please post to POI forum. Thanks.

Original comment by angelo.z...@gmail.com on 1 May 2015 at 7:16