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
- Use `default` or `cluster`.
- Check the exact supported list printed in the error (it is generated at runtime from Config).
- 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
- Only default and cluster exist; do not guess other names.
- Lowercase via Locale.ROOT before validating to match the library.
- Generate help text from Config.getTableMethodOptions.
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
- Unsupported image format '%s'. Supported values: png, jpeg
- Option --table-method requires a value. Supported values: %s
- Unsupported value '%s'. Supported values: all, hidden-text,
- Unsupported format '%s'. Supported values: json, text, html,
- Unsupported hybrid backend '%s'. Supported values: %s
AI-assisted analysis of opendataloader-project/opendataloader-pdf@a7789b8e77 (2026-08-14).
Data as JSON: /api/errors/53e51642347486d8.
Report an issue: GitHub.