virtual string dump() { return "<undef>"; }
};
-struct page_out {
+struct out_context {
QPDFObjectHandle resources;
QPDFObjectHandle xobjects;
string contents;
int res_cnt;
string new_resource(const string type);
- page_out() { res_cnt = 0; }
+ out_context() { res_cnt = 0; }
};
struct page {
int index;
- double width;
+ double width; // Physical dimensions of media
double height;
- virtual void render(page_out *out UNUSED, pdf_matrix xform UNUSED) { abort(); }
+ BBox bbox; // Bounds useful contents
+ virtual void render(out_context *out UNUSED, pdf_matrix xform UNUSED) { abort(); }
page(double _w=0, double _h=0) : width(_w), height(_h) { }
+ page(page *p) {
+ index = p->index;
+ width = p->width;
+ height = p->height;
+ bbox = p->bbox;
+ }
};
struct empty_page : public page {
- void render(page_out *out UNUSED, pdf_matrix xform UNUSED) { }
+ void render(out_context *out UNUSED, pdf_matrix xform UNUSED) { }
empty_page(double _w=0, double _h=0) : page(_w, _h) { };
};
// parse.cc
void parse(const char *in, list<cmd *> &cmds);
+void help();
// cmds.cc
extern const cmd_def cmd_table[];
+
+// gs.cc
+
+vector<BBox> gs_bboxes(const char *in);