  
  #endif
 diff --git a/cpp/poppler-page-renderer.cpp b/cpp/poppler-page-renderer.cpp
-index 1317192..f665b94 100644
+index 1317192..acfa792 100644
 --- a/cpp/poppler-page-renderer.cpp
 +++ b/cpp/poppler-page-renderer.cpp
 @@ -28,6 +28,9 @@

 };
 
 
@@ -194,6 +203,55 @@ image page_renderer::render_page(const page *p,
 #endif
 }
 
+#ifdef HAVE_CAIRO
+/**
+ Render the specified page to the given cairo_t.
+
+ This functions renders the specified page on an image following the specified

+        d->cairo_output_dev = new CairoOutputDev();
+        d->cairo_output_dev->startDoc(pdfdoc);
+    }
+    d->cairo_output_dev->setCairo(typed_cr);
+    d->cairo_output_dev->setPrinting(printing);
+
+    cairo_save(typed_cr);
+    printf("calling display page slice for page %d (1 idx)\n", pp->index + 1);
+    pdfdoc->displayPageSlice(d->cairo_output_dev, pp->index + 1,
+                             xres, yres, int(rotate) * 90,
+                             gFalse, gTrue, printing,
+                             x, y, w, h);
+    cairo_restore(typed_cr);
+    d->cairo_output_dev->setCairo(NULL);
+#else
+    printf("MISSING CAIRO IN POPPLER!\n");
+#endif  // HAVE_CAIRO
+}
+
+/**
  Rendering capability test.
 
  page_renderer can render only if a render backend ('Splash') is compiled in
diff --git a/cpp/poppler-page-renderer.h b/cpp/poppler-page-renderer.h
index 1383865..f38be43 100644
--- a/cpp/poppler-page-renderer.h
+++ b/cpp/poppler-page-renderer.h
@@ -53,6 +53,11 @@ public:
                       double xres = 72.0, double yres = 72.0,
                       int x = -1, int y = -1, int w = -1, int h = -1,
                       rotation_enum rotate = rotate_0) const;
+    void cairo_render_page(void* cr, const page *p,
+                           bool printing,
+                           double xres = 72.0, double yres = 72.0,
+                           int x = -1, int y = -1, int w = -1, int h = -1,
+                           rotation_enum rotate = rotate_0);
 
     static bool can_render();
 
