public void setOcrStrategyAuto(String ocrStrategyAuto) {
        final String regex = "^\\s*(faster|better)|(\\d{1,3})(%)?(?:,\\s*(\\d{1,3}))?\\s*$";
        Pattern pattern = Pattern.compile(regex);
        Matcher matcher = pattern.matcher(ocrStrategyAuto);
        if (matcher.matches()) {
            final String group1 = matcher.group(1);

            if ("better".equals(group1)) {
                this.ocrStrategyAuto = OCR_STRATEGY_AUTO_BETTER;
            } else if ("faster".equals(group1)) {
                this.ocrStrategyAuto = OCR_STRATEGY_AUTO_FASTER;
            } else {
                float unmappedUnicodeCharsPerPage = Integer.parseInt(matcher.group(2));
                if (matcher.group(3) != null) {
                    // If we have the percent sign, then convert
                    if (unmappedUnicodeCharsPerPage > 100.0) {
                        throw new IllegalArgumentException
                        ("Error parsing OCRStrategyAuto - Percent cannot exceed 100%");
                    }
                    unmappedUnicodeCharsPerPage = unmappedUnicodeCharsPerPage / 100f;
                }
                // The 2nd number is optional.  Default to 10 chars per page
                int totalCharsPerPage = matcher.group(4) == null
                        ? OCR_STRATEGY_AUTO_DEFAULT_CHARS_PER_PAGE
                        : Integer.parseInt(matcher.group(4));
                this.ocrStrategyAuto = new OCRStrategyAuto(unmappedUnicodeCharsPerPage, totalCharsPerPage);
            }
            userConfigured.add("ocrStrategyAuto");

        } else {
            throw new IllegalArgumentException("Error parsing OCRStrategyAuto - Must be in the form 'num[%], num'");
        }
    }
Which strategy to use for OCR

@param ocrStrategy
tika-parsers/tika-parsers-standard/tika-parsers-standard-modules/tika-parser-pdf-module/src/main/java/org/apache/tika/parser/pdf/PDFParserConfig.java