opendataloader-project/opendataloader-pdf · error · IllegalArgumentException

Unsupported table method '%s'. Supported values: %s

Error message

Unsupported table method '%s'. Supported values: %s

What it means

Thrown when --table-method receives a non-empty value that is not in the table-method domain. The value is trimmed and lowercased, then checked via Config.isValidTableMethod against {default, cluster}; any other string is rejected with both the bad value and the full supported list. The cluster method combines border-based and cluster-based detection.

Source

Thrown at java/opendataloader-pdf-core/src/main/java/org/opendataloader/pdf/api/cli/CLIOptions.java:511

    }

    private static void applyPagesOption(Config config, CommandLine commandLine) {
        if (commandLine.hasOption(PAGES_LONG_OPTION)) {
            config.setPages(commandLine.getOptionValue(PAGES_LONG_OPTION));
        }
    }

    private static void applyTableMethodOption(Config config, CommandLine commandLine) {
        if (commandLine.hasOption(TABLE_METHOD_LONG_OPTION)) {
            String methodValue = commandLine.getOptionValue(TABLE_METHOD_LONG_OPTION);
            if (methodValue == null || methodValue.trim().isEmpty()) {
                throw new IllegalArgumentException(
                        String.format("Option --table-method requires a value. Supported values: %s",
                                Config.getTableMethodOptions(", ")));
            }
            String method = methodValue.trim().toLowerCase(Locale.ROOT);
            if (!Config.isValidTableMethod(method)) {
                throw new IllegalArgumentException(
                        String.format("Unsupported table method '%s'. Supported values: %s",
                                method, Config.getTableMethodOptions(", ")));
            }
            config.setTableMethod(method);
        }
    }

    private static void applyContentSafetyOption(Config config, CommandLine commandLine) {
        if (!commandLine.hasOption(CONTENT_SAFETY_OFF_LONG_OPTION)) {
            return;
        }

        String[] optionValues = commandLine.getOptionValues(CONTENT_SAFETY_OFF_LONG_OPTION);
        if (optionValues == null || optionValues.length == 0) {
            throw new IllegalArgumentException(
                    "Option --content-safety-off requires at least one value. Supported values: all, hidden-text, off-page, tiny, hidden-ocg");
        }

View on GitHub (pinned to a7789b8e77)

Solutions

  1. Use `default` or `cluster`.
  2. Check the exact supported list printed in the error (it is generated at runtime from Config).
  3. Remove the flag for the default behavior.

Example fix

// before
opendataloader-pdf doc.pdf --table-method border
// after
opendataloader-pdf doc.pdf --table-method default
Defensive patterns

Strategy: type-guard

Validate before calling

String m = userValue.trim().toLowerCase(Locale.ROOT);
if (!Config.isValidTableMethod(m)) {
    throw new IllegalArgumentException(
        "Unsupported table method '" + userValue + "'. Use: " + Config.getTableMethodOptions(", "));
}

Type guard

boolean isAcceptableTableMethod(String v) {
    return v != null && Config.isValidTableMethod(v.trim().toLowerCase(Locale.ROOT));
}

Try / catch

try {
    config.setTableMethod(m);
} catch (IllegalArgumentException e) {
    config.setTableMethod(Config.TABLE_METHOD_DEFAULT);
}

Prevention

When it happens

Trigger: Pass `--table-method lattic`, a typo like `defualt` or `defult`, or an anticipated-but-unimplemented name like `--table-method ml` or `--table-method border`.

Common situations: Typos; assuming a value from an older/newer version or a different tool; docs that mention an internal codename rather than the CLI token.

Related errors


AI-assisted analysis of opendataloader-project/opendataloader-pdf@a7789b8e77 (2026-08-14). Data as JSON: /api/errors/53e51642347486d8. Report an issue: GitHub.