EvRectangle *points)
{
PopplerPage *poppler_page;
- PopplerRectangle r;
- double height;
char *retval;
-
+
poppler_page = POPPLER_PAGE (page->backend_page);
+#ifdef HAVE_POPPLER_PAGE_GET_SELECTED_TEXT
+ retval = poppler_page_get_selected_text (poppler_page,
+ (PopplerSelectionStyle)style,
+ (PopplerRectangle *)points);
+#else
+ PopplerRectangle r;
+ double height;
+
poppler_page_get_size (poppler_page, NULL, &height);
r.x1 = points->x1;
r.y1 = height - points->y2;
retval = poppler_page_get_text (poppler_page,
(PopplerSelectionStyle)style,
&r);
+#endif /* HAVE_POPPLER_PAGE_GET_SELECTED_TEXT */
return retval;
}
return retval;
}
+#ifdef HAVE_POPPLER_PAGE_GET_SELECTED_TEXT
+static gchar *
+pdf_document_text_get_text (EvDocumentText *selection,
+ EvPage *page)
+{
+ PopplerPage *poppler_page;
+
+ g_return_val_if_fail (POPPLER_IS_PAGE (page->backend_page), NULL);
+
+ poppler_page = POPPLER_PAGE (page->backend_page);
+
+ return poppler_page_get_text (poppler_page);
+}
+#else
static gchar *
pdf_document_text_get_text (EvDocumentText *selection,
EvPage *page)
POPPLER_SELECTION_WORD,
&r);
}
+#endif /* HAVE_POPPLER_PAGE_GET_SELECTED_TEXT */
#ifdef HAVE_POPPLER_PAGE_GET_TEXT_LAYOUT
static gboolean
evince_save_LIBS=$LIBS
LIBS="$LIBS $POPPLER_LIBS"
AC_CHECK_FUNCS(poppler_page_get_text_layout)
+ AC_CHECK_FUNCS(poppler_page_get_selected_text)
LIBS=$evince_save_LIBS
PKG_CHECK_MODULES(CAIRO_PDF, cairo-pdf, enable_cairo_pdf=yes, enable_cairo_pdf=no)
if test x$enable_cairo_pdf = xyes; then