for (int i = 1; i < args.length; i++) {
if ("fill_form".equals(args[i])) {
config.formInputStream = System.in;
i++;
if (!"-".equals(args[i])) {
throw new RuntimeException("Missing \"-\" after fill_form operation.");
}
} else if ("output".equals(args[i])) {
i++;
if (!"-".equals(args[i])) {
throw new RuntimeException("Missing \"-\" after output operation.");
}
} else if ("flatten".equals(args[i])) {
config.flatten = true;
} else {
throw new RuntimeException("Unknown operation: " + args[i]);
}
}
Drop-in, блять, replacement for pdftk. Он, вообще-то, не три, а целых девятнадцать операций выполняет! Мудаки.