I want to get headings h1, h2 from a word docx file with the page number from where it is fetched. e.g. there are headings "heading h1" and "heading h2" in page 1 and other h1,h2 headings on other pages. I want to get these with the page number they are fetched from. Can be something like
array(
0 => array(
h1 => array('h1 headings goes here'),
h2 => array('h2 headings goes here...')
page=>'page number here'))
I am able to get headings by converting docx to zip and reading the xml using DOM Document. But I am not able to get the page number from where I picked a particular heading.
Please share the best way to achieve this functionality.