code: public void onGenericTag(PdfWriter writer, Document document,
              Rectangle rect, String text) {
          indextag.put(text, Integer.valueOf(writer.getPageNumber()));
      }
docs: All the text that is passed to this event, gets registered in the indexentry.
  
  @see com.lowagie.text.pdf.PdfPageEventHelper#onGenericTag(
  com.lowagie.text.pdf.PdfWriter, com.lowagie.text.Document,
  com.lowagie.text.Rectangle, java.lang.String)