+static char *
+pdf_document_get_text (EvDocument *document, GdkRectangle *rect)
+{
+ PdfDocument *pdf_document = PDF_DOCUMENT (document);
+ GString *sel_text = new GString;
+ const char *text;
+ int x1, y1, x2, y2;
+
+ x1 = rect->x;
+ y1 = rect->y;
+ x2 = x1 + rect->width;
+ y2 = y1 + rect->height;
+
+ sel_text = pdf_document->out->getText (x1, y1, x2, y2);
+ text = sel_text->getCString ();
+
+ return text ? g_strdup (text) : NULL;
+}
+