Page 1 of 1

Parsing Image using docx4j

PostPosted: Tue Mar 02, 2010 9:35 pm
by RithanyaLaxmi
Hi,

I have an image in document.xml (converted from .docx) , i need to parse the image how to do it? I checked the samples which doesnot have any files for Image parsing. Please do provide a sample example for parsing the Image.

Thanks,
Rithu

Re: Parsing Image using docx4j

PostPosted: Tue Mar 02, 2010 10:57 pm
by jason
Hi Rithu

When you say "parse an image", what exactly do you want to do?

The PartsList sample will show you which part your image is in. http://dev.plutext.org/trac/docx4j/brow ... sList.java

Once you have the part, you can for example save the image to a file. But that might not be what you want to do.

Each image part will be referenced from somewhere (eg document.xml or a header or footer), using a relationship id.

You can change the relationship id to point to a different image.

When docx4j is used for HTML or PDF export, it uses the following package to handle images (nb, this was cleaned up substantially following the release of 2.3.0). http://dev.plutext.org/trac/docx4j/brow ... del/images

cheers .. Jason