tianchiing / xdocreport

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

ClassCastException: Insertion of illegal Element: 12 while converting ODT to PDF #287

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Download zip archive with odt-to-pdf-converter 
(https://github.com/javadev/odt-to-pdf-converter/raw/master/odttopdf.zip)
2. Start program, select file declar_quarter.odt
3. Press OK button

What is the expected output? What do you see instead?

There is PDF file should be created

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

1.0.2

Please provide any additional information below.

The stack trace:

2013-08-01 10:01:59.366 SEVERE com.github.odttopdf.OdtToPdfConverter - 
org.odftoolkit.odfdom.converter.core.ODFConverter
Exception: java.lang.ClassCastException: Insertion of illegal Element: 12
Error is: fr.opensagres.xdocreport.converter.XDocConverterException Message: 
org.odftoolkit.odfdom.converter.core.ODFCon
verterException: java.lang.ClassCastException: Insertion of illegal Element: 12
        fr.opensagres.xdocreport.converter.odt.odfdom.itext.ODF2PDFViaITextConverter.convert(ODF2PDFViaITextConverter.ja
va:66)
        fr.opensagres.xdocreport.document.AbstractXDocReport.convert(AbstractXDocReport.java:710)
        -->com.github.odttopdf.OdtToPdfConverter.createDocument(OdtToPdfConverter.java:83)
        -->com.github.odttopdf.OdtToPdfConverterApp$7.run(OdtToPdfConverterApp.java:354)
The cause is org.odftoolkit.odfdom.converter.core.ODFConverterException 
Message: org.odftoolkit.odfdom.converter.core.OD
FConverterException: java.lang.ClassCastException: Insertion of illegal 
Element: 12
        org.odftoolkit.odfdom.converter.pdf.PdfConverter.doConvert(PdfConverter.java:82)
        org.odftoolkit.odfdom.converter.pdf.PdfConverter.doConvert(PdfConverter.java:43)
        org.odftoolkit.odfdom.converter.core.AbstractODFConverter.convert(AbstractODFConverter.java:42)
        fr.opensagres.xdocreport.converter.odt.odfdom.itext.ODF2PDFViaITextConverter.convert(ODF2PDFViaITextConverter.ja
va:62)
        fr.opensagres.xdocreport.document.AbstractXDocReport.convert(AbstractXDocReport.java:710)
        -->com.github.odttopdf.OdtToPdfConverter.createDocument(OdtToPdfConverter.java:83)
        -->com.github.odttopdf.OdtToPdfConverterApp$7.run(OdtToPdfConverterApp.java:354)
The cause is java.lang.ClassCastException Message: 
org.odftoolkit.odfdom.converter.core.ODFConverterException: java.lang
.ClassCastException: Insertion of illegal Element: 12
        com.lowagie.text.Phrase.add(Unknown Source)
        fr.opensagres.xdocreport.itext.extension.ExtendedParagraph.addElement(ExtendedParagraph.java:61)
        org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.addITextContainer(ElementVisitorForIText.jav
a:704)
        org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.addITextContainer(ElementVisitorForIText.jav
a:692)
        org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.visit(ElementVisitorForIText.java:320)
        org.odftoolkit.odfdom.dom.element.text.TextPElement.accept(TextPElement.java:1681)
        org.odftoolkit.odfdom.converter.core.ElementVisitorConverter.visit(ElementVisitorConverter.java:82)
        org.odftoolkit.odfdom.dom.DefaultElementVisitor.visit(DefaultElementVisitor.java:1557)
        org.odftoolkit.odfdom.dom.element.draw.DrawCustomShapeElement.accept(DrawCustomShapeElement.java:408)
        org.odftoolkit.odfdom.converter.core.ElementVisitorConverter.visit(ElementVisitorConverter.java:82)
        org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.addITextContainer(ElementVisitorForIText.jav
a:701)
        org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.addITextContainer(ElementVisitorForIText.jav
a:692)
        org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.visit(ElementVisitorForIText.java:320)
        org.odftoolkit.odfdom.dom.element.text.TextPElement.accept(TextPElement.java:1681)
        org.odftoolkit.odfdom.converter.core.ElementVisitorConverter.visit(ElementVisitorConverter.java:82)
        org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.addITextContainer(ElementVisitorForIText.jav
a:701)
        org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.addITextContainer(ElementVisitorForIText.jav
a:692)
        org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.visit(ElementVisitorForIText.java:468)
        org.odftoolkit.odfdom.dom.element.table.TableTableCellElement.accept(TableTableCellElement.java:726)
        org.odftoolkit.odfdom.converter.core.ElementVisitorConverter.visit(ElementVisitorConverter.java:82)
        org.odftoolkit.odfdom.dom.DefaultElementVisitor.visit(DefaultElementVisitor.java:3909)
        org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.visit(ElementVisitorForIText.java:437)
        org.odftoolkit.odfdom.dom.element.table.TableTableRowElement.accept(TableTableRowElement.java:223)
        org.odftoolkit.odfdom.converter.core.ElementVisitorConverter.visit(ElementVisitorConverter.java:82)
        org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.addITextContainer(ElementVisitorForIText.jav
a:701)
        org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.addITextContainer(ElementVisitorForIText.jav
a:692)
        org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.visit(ElementVisitorForIText.java:410)
        org.odftoolkit.odfdom.dom.element.table.TableTableElement.accept(TableTableElement.java:678)
        org.odftoolkit.odfdom.converter.core.ElementVisitorConverter.visit(ElementVisitorConverter.java:82)
        org.odftoolkit.odfdom.dom.DefaultElementVisitor.visit(DefaultElementVisitor.java:2605)
        org.odftoolkit.odfdom.converter.pdf.internal.ElementVisitorForIText.visit(ElementVisitorForIText.java:248)
        org.odftoolkit.odfdom.dom.element.office.OfficeTextElement.accept(OfficeTextElement.java:805)
        org.odftoolkit.odfdom.converter.pdf.PdfConverter.processBody(PdfConverter.java:126)
        org.odftoolkit.odfdom.converter.pdf.PdfConverter.doConvert(PdfConverter.java:65)
        org.odftoolkit.odfdom.converter.pdf.PdfConverter.doConvert(PdfConverter.java:43)
        org.odftoolkit.odfdom.converter.core.AbstractODFConverter.convert(AbstractODFConverter.java:42)
        fr.opensagres.xdocreport.converter.odt.odfdom.itext.ODF2PDFViaITextConverter.convert(ODF2PDFViaITextConverter.ja
va:62)
        fr.opensagres.xdocreport.document.AbstractXDocReport.convert(AbstractXDocReport.java:710)
        -->com.github.odttopdf.OdtToPdfConverter.createDocument(OdtToPdfConverter.java:83)
        -->com.github.odttopdf.OdtToPdfConverterApp$7.run(OdtToPdfConverterApp.java:354)

Original issue reported on code.google.com by valyakol on 1 Aug 2013 at 7:05

Attachments:

GoogleCodeExporter commented 8 years ago
Hi,

Thank's to attach your odt. We will see your problem when we will have time.

Regards Angelo

Original comment by angelo.z...@gmail.com on 1 Aug 2013 at 8:04

GoogleCodeExporter commented 8 years ago
Exception during conversion is fixed in 1.0.3 version
However the resulting pdf loses some content of the original odt (graphic boxes 
are not supported). See 
https://code.google.com/p/xdocreport/wiki/ODFDOMConverterPDFViaIText to read 
about converter limitations

Original comment by abe...@gmail.com on 21 Aug 2013 at 10:36

GoogleCodeExporter commented 8 years ago

Original comment by abe...@gmail.com on 21 Aug 2013 at 10:38