From: Marco Pesenti Gritti Date: Tue, 5 Apr 2005 09:34:03 +0000 (+0000) Subject: Make clipboard work again X-Git-Tag: EVINCE_0_2_0~6 X-Git-Url: https://www.fi.muni.cz/~kas/git//home/kas/public_html/git/?a=commitdiff_plain;h=067a8759e04f2c657eb49c26263b75e3ac26a706;p=evince.git Make clipboard work again 2005-04-05 Marco Pesenti Gritti * pdf/ev-poppler.cc: Make clipboard work again --- diff --git a/ChangeLog b/ChangeLog index ac173d37..7c7cb417 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2005-04-05 Marco Pesenti Gritti + + * pdf/ev-poppler.cc: + + Make clipboard work again + 2005-04-04 Kristian Høgsberg Make searching work again. diff --git a/pdf/ev-poppler.cc b/pdf/ev-poppler.cc index 7fcc9c0d..4ca7d017 100644 --- a/pdf/ev-poppler.cc +++ b/pdf/ev-poppler.cc @@ -328,7 +328,27 @@ pdf_document_set_password (EvDocumentSecurity *document_security, document->password = g_strdup (password); } +static char * +pdf_document_get_text (EvDocument *document, int page, EvRectangle *rect) +{ + PdfDocument *pdf_document = PDF_DOCUMENT (document); + PopplerPage *poppler_page; + PopplerRectangle r; + double height; + + poppler_page = poppler_document_get_page (pdf_document->document, page); + g_return_val_if_fail (poppler_page != NULL, NULL); + + poppler_page_get_size (poppler_page, NULL, &height); + r.x1 = rect->x1; + r.y1 = height - rect->y2; + r.x2 = rect->x2; + r.y2 = height - rect->y1; + g_print ("%f %f %f %f\n", r.x1, r.y1, r.x2, r.y2); + + return poppler_page_get_text (poppler_page, &r); +} static void pdf_document_document_iface_init (EvDocumentIface *iface) @@ -340,6 +360,7 @@ pdf_document_document_iface_init (EvDocumentIface *iface) iface->get_page_label = pdf_document_get_page_label; iface->get_links = pdf_document_get_links; iface->render_pixbuf = pdf_document_render_pixbuf; + iface->get_text = pdf_document_get_text; }; static void @@ -703,7 +724,7 @@ pdf_document_find_get_result (EvDocumentFind *document_find, PopplerPage *poppler_page; PopplerRectangle *r; int current_page; - double scale, height; + double height; if (search == NULL) return FALSE;