private static IMAGE_STRATEGY parse(String s) {
            String lc = s.toLowerCase(Locale.US);
            switch (lc) {
                case "rawimages" :
                    return RAW_IMAGES;
                case "renderpagesbeforeparse":
                    return RENDER_PAGES_BEFORE_PARSE;
                case "renderpagesatpageend":
                    return RENDER_PAGES_AT_PAGE_END;
                case "none":
                    return NONE;
                default:
                    //fall through to exception
                    break;
            }
            StringBuilder sb = new StringBuilder();
            sb.append("I regret that I don't recognize '").append(s);
            sb.append("' as an IMAGE_STRATEGY. I only recognize:");
            int i = 0;
            for (IMAGE_STRATEGY strategy : IMAGE_STRATEGY.values()) {
                if (i++ > 0) {
                    sb.append(", ");
                }
                sb.append(strategy.toString());
            }
            throw new IllegalArgumentException(sb.toString());
        }
This renders each page, one at a time, at the end of the page.
For some rendering engines, this may be slower, but it allows the writing
of image metadata into the xhtml in the proper location
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-pdf-module/src/main/java/org/apache/tika/parser/pdf/PDFParserConfig.java