@Override
    public void characters(char[] ch, int start, int length) throws SAXException {
        if (inContent) {
            handler.characters(ch, start, length);
        }

        if (inPage) {
            switch (String.valueOf(ch)) {
                case "BodyPage":
                    bodyPageCount++;
                    break;
                case "LeftMasterPage":
                case "RightMasterPage":
                case "OtherMasterPage":
                    masterPageCount++;
                    break;
                case "ReferencePage":
                    referencePageCount++;
                    break;
                default:
                    break;
            }
        }

    }
Default content handler for MIF Content and Metadata.

@param handler  the base content handler to use.
@param metadata the metadata collection to populate.
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-miscoffice-module/src/main/java/org/apache/tika/parser/mif/MIFContentHandler.java