Page 1 of 1

Open documents with images requires xmlgraphics jar

PostPosted: Fri May 27, 2011 2:14 am
by naked11
in this code, return exception, pls help

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
private WordprocessingMLPackage dokument = new WordprocessingMLPackage();
 public DocxReader(String fileName) {
        try {
            dokument = WordprocessingMLPackage.load(new File(String fileName));
            stylyDokumentu = dokument.getMainDocumentPart().getStyleDefinitionsPart().getJaxbElement();
        } catch (Docx4JException ex) {
            System.out.println("ERR");
            // Logger.getLogger(DocxReader.class.getName()).log(Level.SEVERE, null, ex);
        }
    }  
 
Parsed in 0.014 seconds, using GeSHi 1.0.8.4


>> >> >> Exception in thread "AWT-EventQueue-0"
>> >> java.lang.NoClassDefFoundError:
>> >> >> org/apache/xmlgraphics/image/loader/ImageContext
>> >> >> at

Re: Open wordprocessing package fail, maybe images in docume

PostPosted: Fri May 27, 2011 2:21 am
by jason
Add the xmlGraphics jar to your class path; its part of the docx4j distribution.