{ "url", 0, 0, OptionArg.STRING, ref opt_url, "Url to grab", null },
{ "delay", 0, 0, OptionArg.INT, ref opt_delay, "Delay before snapshot in seconds", null },
- //{ "png", 0, 0, OptionArg.STRING, ref opt_target_png, "File to write (PNG)", null },
+ { "png", 0, 0, OptionArg.STRING, ref opt_target_png, "File to write (PNG)", null },
{ "inject", 0, 0, OptionArg.STRING_ARRAY, ref opt_inject_js, "Inject Javascript file(s)", null },
{ "pdf", 0, 0, OptionArg.STRING, ref opt_target_pdf, "File to write (PDF)", null },
{ null }
if (webkitpdf.opt_url == null) {
throw new OptionError.BAD_VALUE("missing url");
}
- //if (webkitpdf.opt_target_png == null) {
- // throw new OptionError.BAD_VALUE("missing png" file path);
- //}
+ if (webkitpdf.opt_target_png == null && webkitpdf.opt_target_pdf == null) {
+ throw new OptionError.BAD_VALUE("missing pdf or png filename");
+ }
if (webkitpdf.opt_target_pdf == null) {
throw new OptionError.BAD_VALUE("missing pdf file path");
}