+ return surface;
+}
+
+static cairo_surface_t *
+pdf_document_render (EvDocument *document,
+ EvRenderContext *rc)
+{
+ PdfDocument *pdf_document;
+ double width_points, height_points;
+ gint width, height;
+
+ pdf_document = PDF_DOCUMENT (document);
+
+ set_rc_data (pdf_document, rc);
+
+ poppler_page_get_size (POPPLER_PAGE (rc->data),
+ &width_points, &height_points);
+
+ if (rc->rotation == 90 || rc->rotation == 270) {
+ width = (int) ((height_points * rc->scale) + 0.5);
+ height = (int) ((width_points * rc->scale) + 0.5);
+ } else {
+ width = (int) ((width_points * rc->scale) + 0.5);
+ height = (int) ((height_points * rc->scale) + 0.5);
+ }
+
+ return pdf_page_render (POPPLER_PAGE (rc->data),
+ width, height, rc);