- What if an input page specifies /Rotate?
- Better error messages from instantiation
- page->index: use or remove
+- rename page->bbox to page->image_box?
+
+# Position bbox on a new paper
+paper("a4")
+paper(w=210mm,h=297mm,pos=(t|b|c)(l|r|c))
+
+# Scale paper to a new size
+scaleto("a4")
+scaleto(w=210mm,h=297mm,pos=tl)
+
+# Fit image to a paper
+# If paper is given: scale image
+# If no paper is given: adjust paper to image + margins
+fit("a4")
+fit(w=, h=)
+margin= hmargin= vmargin=
+lmargin= rmargin= tmargin= bmargin=
+pos=
+
+# Adjust paper size
+expand(10mm)
+expand(h=10mm, v=20mm)
+expand(l=10mm, r=10mm, t=10mm, b=10mm)
+
+# Adjust image size (in terms of margins around)
+margins ... params like expand
static void do_recalc_bbox(vector<page *> &pages, const char *in_name)
{
+ debug("Calling Ghostscript to re-calculate bounding boxes");
vector<BBox> bboxes = gs_bboxes(in_name);
if (pages.size() != bboxes.size())
die("Ghostscript failed to produce the right number of bboxes");