width = media.width();
height = media.height();
- bbox = p->bbox;
- bbox.transform(xf);
+ image_box = p->image_box;
+ image_box.transform(xf);
}
void xform_page::render(out_context *out, pdf_matrix parent_xform)
"q " +
xform.to_string() + " cm " +
"0 1 0 RG " +
- bbox.to_rect() + " re S " +
+ image_box.to_rect() + " re S " +
"Q ";
}
{
width = p->width;
height = p->height;
- bbox = p->bbox;
+ image_box = p->image_box;
first = false;
}
else
{
if (!is_equal(width, p->width) || !is_equal(height, p->height))
die("All pages participating in a merge must have the same dimensions");
- bbox.join(p->bbox);
+ image_box.join(p->image_box);
}
}
}
page *process_page(page *p) override
{
BBox paper_box = BBox(paper.w, paper.h);
- pdf_matrix xf = pos.place(p->bbox, paper_box);
+ pdf_matrix xf = pos.place(p->image_box, paper_box);
page *q = new xform_page(p, xf);
q->width = paper.w;
q->height = paper.h;
if (!is_zero(paper.w) && !is_zero(paper.h))
{
// Paper given: scale image to fit paper
- BBox orig_box = p->bbox;
+ BBox orig_box = p->image_box;
BBox paper_box = BBox(paper.w, paper.h);
marg.shrink_box(&paper_box);
xf.scale(scale_to_fit(orig_box, paper_box));
else
{
// No paper given: adjust paper to fit image
- xf.shift(-p->bbox.x_min, -p->bbox.y_min);
+ xf.shift(-p->image_box.x_min, -p->image_box.y_min);
xf.shift(marg.l, marg.b);
q = new xform_page(p, xf);
- q->width = p->bbox.width() + marg.l + marg.r;
- q->height = p->bbox.height() + marg.t + marg.b;
+ q->width = p->image_box.width() + marg.l + marg.r;
+ q->height = p->image_box.height() + marg.t + marg.b;
}
return q;
}
page *process_page(page *p) override
{
pdf_matrix xf;
- xf.shift(-p->bbox.x_min, -p->bbox.y_min);
+ xf.shift(-p->image_box.x_min, -p->image_box.y_min);
xf.shift(marg.l, marg.b);
page *q = new xform_page(p, xf);
- q->width = p->bbox.width() + marg.l + marg.r;
- q->height = p->bbox.height() + marg.t + marg.b;
+ q->width = p->image_box.width() + marg.l + marg.r;
+ q->height = p->image_box.height() + marg.t + marg.b;
if (q->width < 0.001 || q->height < 0.001)
die("Margins must result in positive page dimensions");
return q;
for (int i=0; i<num_tiles; i++)
{
if (crop)
- page_boxes[i] = in[i]->bbox;
+ page_boxes[i] = in[i]->image_box;
else
page_boxes[i] = BBox(in[i]->width, in[i]->height);
st.tile_w = max(st.tile_w, page_boxes[i].width());
pdf_matrix place_xform = pos.place(grid_box, paper_box);
nup_page *p = new nup_page(best);
- p->bbox = grid_box;
- p->bbox.transform(place_xform);
+ p->image_box = grid_box;
+ p->image_box.transform(place_xform);
for (int i=0; i<num_tiles; i++)
{