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

+                           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) const;
+#endif  // HAVE_CAIRO
 
     static bool can_render();

+    page_private *pp = page_private::get(p);
+    PDFDoc *pdfdoc = pp->doc->doc;
+
+    if (!d->cairo_output_dev) {
+        d->cairo_output_dev = new CairoOutputDev();
+        d->cairo_output_dev->startDoc(pdfdoc);
+    }
+    d->cairo_output_dev->setCairo(cr);
+    d->cairo_output_dev->setPrinting(printing);
+
+    cairo_save(cr);
+    pdfdoc->displayPageSlice(d->cairo_output_dev, pp->index + 1,
+                             xres, yres, int(rotate) * 90,
+                             gFalse, gTrue, printing,
+                             x, y, w, h);
+    cairo_restore(cr);
+    d->cairo_output_dev->setCairo(NULL);
+}
+#endif  // HAVE_CAIRO
+
