xr->line_gutter = XR_POINT;
xr->line_space = XR_POINT;
xr->line_width = XR_POINT / 2;
- xr->page_number = 1;
+ xr->page_number = 0;
return xr;
}
xr->cairo = cairo_create (surface);
cairo_surface_destroy (surface);
- cairo_translate (xr->cairo,
- xr_to_pt (xr->left_margin),
- xr_to_pt (xr->top_margin));
-
if (!xr_set_cairo (xr, xr->cairo))
goto error;
+ cairo_save (xr->cairo);
+ xr_driver_next_page (xr, xr->cairo);
+
if (xr->width / (xr->font_height / 2) < MIN_WIDTH)
{
error (0, 0, _("The defined page is not wide enough to hold at least %d "
xr_driver_output_item (xr, output_item);
while (xr_driver_need_new_page (xr))
{
+ cairo_restore (xr->cairo);
cairo_show_page (xr->cairo);
+ cairo_save (xr->cairo);
xr_driver_next_page (xr, xr->cairo);
}
}
void
xr_driver_next_page (struct xr_driver *xr, cairo_t *cairo)
{
+ if (cairo != NULL)
+ cairo_translate (cairo,
+ xr_to_pt (xr->left_margin),
+ xr_to_pt (xr->top_margin));
+
xr->page_number++;
xr->cairo = cairo;
xr->y = 0;