As part of a gui front end that I developed to search an MS Word Document for errors against a master list, I am trying to use the Apache POI HeaderStories getFooter() method to return the footer (unique) of each page of an (n) page document where errors are found.

The API says that by passing the page number to the method, I can target that specific page's footer.Instead I only get the footer of the very last page regardless of what number I pass in. This is my first exposure to Apache poi HWPF. Can anyone shed some light on what I am doing wrong?

Java Code:
 public CorrectLists DocReader(String infile, CorrectLists lists, String SearchString) throws IOException {
    // TODO Auto-generated constructor stub

    lists.DocumentList = new ArrayList<String>();
    pgcnt = 1;

    Vector <String>build_lists = new Vector<String>();
    Vector <String>paragraph = new Vector<String>();
    Writer out =null; 
    Pattern pattern = Pattern.compile("s[1-9].*.[b | k][l]_[a-z]\\d+"); //This pattern is crucial. If future documents fail, check here first!
    Pattern pagenum = Pattern.compile("^\\d{1,2}\r\n");
    String searchtext = SearchString; // "Load and Apply to ClearCase 6 Upgrade"        
    boolean proceed = true; //flag indicating that the first document build list (beyond section 7) can be collected

    try{
        File file = new File(infile);
        DocumentList = new ArrayList<String>();
        POIFSFileSystem fis = new POIFSFileSystem(new FileInputStream(file));
        fos = new FileOutputStream(outfile);
        doc = new HWPFDocument(fis);
        extractor = new WordExtractor(doc);
        Range r = doc.getRange();
        Footer = new HeaderStories(doc);
        String[] fileData = extractor.getParagraphText();
        for ( int index=0; index<fileData.length; index++){
            if(fileData[index] != null ){

                Matcher matcher = pattern.matcher(fileData[index]);
                Matcher page = pagenum.matcher(fileData[index]);

               if(!initialized){
                   pageInit();
               } else {
                   pageupdate( pgcnt);
               }

    // extraneous code omitted here.
    " " "

    " " "

    " " "

    private boolean pageInit() throws IOException{

    try{
        if ((init_Hdr = Footer.getHeader(pgcnt)) != null){
            curr_Footr = Footer.getFooter(pgcnt); 
            System.out.println(Range.stripFields(init_Hdr));
            System.out.println(Range.stripFields(curr_Footr));

            initialized = true;
            ++pgcnt;
        }
    }
    catch(Exception exep){} 
    return initialized;
}

    private void pageupdate(int cnt){
    pgcnt = cnt;
    if(readHeader(pgcnt)){
        ++pgcnt;
        //System.out.println(pgcnt);
    }
}

@SuppressWarnings("deprecation")
public boolean readHeader(int pageNumber){
    HeaderStories headerStore = new HeaderStories(doc);;
    String text = headerStore.getFooter(pageNumber);
    System.out.println(text);
    System.out.println(Range.stripFields(text));
    if(!headerStore.getHeader(pageNumber).isEmpty()){
       return true; 
    }
    else {
      return false;
    }
}