+/*** add-blank ***/
+
+class add_blank_cmd : public cmd_exec {
+ int n;
+ paper_spec paper;
+public:
+ add_blank_cmd(cmd *c) : paper(c, true)
+ {
+ n = c->arg("n")->as_int(1);
+ }
+ vector<page *> process(vector<page *> &pages) override;
+};
+
+vector<page *> add_blank_cmd::process(vector<page *> &pages)
+{
+ vector<page *> out;
+
+ for (auto p: pages)
+ {
+ out.push_back(p);
+ for (int i=0; i<n; i++)
+ {
+ double w = paper.w, h = paper.h;
+ if (is_zero(w) || is_zero(h))
+ w = p->width, h = p->height;
+ out.push_back(new empty_page(w, h));
+ }
+ }
+
+ return out;
+}
+
+static const arg_def add_blank_args[] = {
+ { "n", AT_INT | AT_POSITIONAL },
+ PAPER_ARGS,
+ { NULL, 0 }
+};
+
{ "select", no_args, 1, &ctor<select_cmd> },
{ "apply", no_args, 1, &ctor<apply_cmd> },
{ "modulo", modulo_args, 1, &ctor<modulo_cmd> },
{ "select", no_args, 1, &ctor<select_cmd> },
{ "apply", no_args, 1, &ctor<apply_cmd> },
{ "modulo", modulo_args, 1, &ctor<modulo_cmd> },
- { "draw_bbox",no_args, 0, &ctor<draw_bbox_cmd> },
+ { "draw-bbox",no_args, 0, &ctor<draw_bbox_cmd> },
{ "merge", no_args, 0, &ctor<merge_cmd> },
{ "paper", paper_args, 0, &ctor<paper_cmd> },
{ "scaleto", scaleto_args, 0, &ctor<scaleto_cmd> },
{ "fit", fit_args, 0, &ctor<fit_cmd> },
{ "expand", expand_args, 0, &ctor<expand_cmd> },
{ "margins", margins_args, 0, &ctor<margins_cmd> },
{ "merge", no_args, 0, &ctor<merge_cmd> },
{ "paper", paper_args, 0, &ctor<paper_cmd> },
{ "scaleto", scaleto_args, 0, &ctor<scaleto_cmd> },
{ "fit", fit_args, 0, &ctor<fit_cmd> },
{ "expand", expand_args, 0, &ctor<expand_cmd> },
{ "margins", margins_args, 0, &ctor<margins_cmd> },