Page 1 of 1

Exception when document contains images

PostPosted: Fri Jul 04, 2008 9:41 am
by henk
Hi

I'm trying to open a docx Word document containing images. I try it using the code from the wiki:
Code: Select all
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new java.io.File(inputfilepath));

But this throws an exception since the type image/jpeg is not supported.
Is there another way to open/load the document? I'm not interested in the image, I just want to have a handle to the main document so I can change the text in it.

Thanks

Henk

Re: Exception when document contains images

PostPosted: Tue Jul 15, 2008 12:22 am
by jason
Hi

I created a docx in Word 2007 containing a JPEG, and then used sample [1] to open it as a WordprocessingMLPackage without a problem.

Are you sure your image is a JPEG? You could unzip the docx to verify.

If you attach your docx, I'll have a look at it.

cheers

Jason


[1] http://dev.plutext.org/trac/docx4j/brow ... verse.java