204 gdouble page_width, page_height;
206 double scale_x, scale_y;
207 cairo_surface_t *surface;
209 GError *error = NULL;
211 xps_page = GXPS_PAGE (rc->page->backend_page);
213 gxps_page_get_size (xps_page, &page_width, &page_height);
217 surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
219 cr = cairo_create (surface);
221 cairo_set_source_rgb (cr, 1., 1., 1.);
224 switch (rc->rotation) {
226 cairo_translate (cr, width, 0);
229 cairo_translate (cr, width, height);
232 cairo_translate (cr, 0, height);
235 cairo_translate (cr, 0, 0);
240 cairo_scale (cr, scale_x, scale_y);
242 cairo_rotate (cr, rc->rotation * G_PI / 180.0);
243 gxps_page_render (xps_page, cr, &error);
247 g_warning (
"Error rendering page %d: %s\n",
248 rc->page->index, error->message);
249 g_error_free (error);