private static int i2r(StringBuffer sbuff, int i, String tens, int iTens, String nines,
                           int iNines, String fives, int iFives, String fours, int iFours) {
        while (i >= iTens) {
            sbuff.append(tens);
            i -= iTens;
        }

        if (i >= iNines) {
            sbuff.append(nines);
            i -= iNines;
        }

        if (i >= iFives) {
            sbuff.append(fives);
            i -= iFives;
        }
        if (i >= iFours) {
            sbuff.append(fours);
            i -= iFours;
        }
        return i;
    }
Utility class to allow for conversion from an integer to Roman numerals
or alpha-numeric symbols in line with Pages auto numbering formats.
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-apple-module/src/main/java/org/apache/tika/parser/iwork/AutoPageNumberUtils.java