          globalParams = new GlobalParams();
          setErrorCallback(detail::error_function, NULL);
      }
-@@ -662,3 +664,65 @@ document* document::load_from_raw_data(const char *file_data,
+@@ -662,3 +664,71 @@ document* document::load_from_raw_data(const char *file_data,
                                  owner_password, user_password);
      return document_private::check_document(doc, 0);
  }

+namespace poppler {
+SimpleDocument::SimpleDocument(const char* buf, size_t length)
+    : buf_copy_(new char[length]),
+      stream_(NULL), doc_(NULL), out_dev_(NULL), initer_(NULL) {
+  initer_ = new initer();
+  printf("about to do memcpy\n");
+  memcpy(buf_copy_, buf, length);
+  printf("memcpy done\n");
+  Object obj;
+  printf("about to do memstream\n");
+  stream_ = new MemStream(buf_copy_, 0, length, obj.initNull());
+  printf("about to do pdfdoc\n");
+  doc_ = new PDFDoc(stream_);
+  printf("about to do cairo out dev\n");
+  out_dev_ = new CairoOutputDev();
+  printf("about to do start doc on cairo\n");

+  delete doc_;
+  printf("~smpledoc: %d\n", __LINE__);
+  doc_ = NULL;
+  printf("~smpledoc: %d\n", __LINE__);
+  delete[] buf_copy_;
+  printf("~smpledoc: %d\n", __LINE__);
