286 SpectrePage *ps_page;
287 SpectreRenderContext *src;
291 gint swidth, sheight;
295 cairo_surface_t *surface;
296 static const cairo_user_data_key_t key;
298 ps_page = (SpectrePage *)rc->page->backend_page;
300 spectre_page_get_size (ps_page, &width_points, &height_points);
307 if (rotation == 90 || rotation == 270) {
315 src = spectre_render_context_new ();
316 spectre_render_context_set_scale (src,
317 (gdouble)swidth / width_points,
318 (gdouble)sheight / height_points);
319 spectre_render_context_set_rotation (src, rotation);
320 spectre_page_render (ps_page, src, &data, &stride);
321 spectre_render_context_free (src);
327 if (spectre_page_status (ps_page)) {
328 g_warning (
"%s", spectre_status_to_string (spectre_page_status (ps_page)));
334 surface = cairo_image_surface_create_for_data (data,
338 cairo_surface_set_user_data (surface, &key,
339 data, (cairo_destroy_func_t)g_free);