Reading Microsoft Word in order read

116 views Asked by At

I am currently implementing an application that reads a Microsoft Word document using Apache POI. As per the API, there exists HWPFDocument class that accepts in an InputStream as part of the constructor.

I would like to read images and tables from the input stream in the order it is received. Although, the API offers to read all the images and all the tables is there any way of either using Apache POI to detect the order. For example, 1 paragraph followed by a table followed by an image. I want to detect the ordering of this input stream to do other things with them. Something like this:

while(input stream != null) {
     // read byte if paragraph do something
    // if table do something
}

Having a look on Google and the Apache POI, I haven't seen anything like this.

0

There are 0 answers