[evince/wip/highlight: 133/145] pdf: saving evince highlight annotation to poppler



commit f65f0c28b3ec40957bb22470d9eab61c5b0ed1b6
Author: Giselle Reis <gisellemnr src gnome org>
Date:   Thu Aug 7 17:19:09 2014 +0200

    pdf: saving evince highlight annotation to poppler
    
    Creates a poppler highlight annotation from evince's
    highlight annotation.
    
    Depends on poppler patch that implements
    poppler_page_get_quadrilaterals_for_area.

 backend/pdf/ev-poppler.cc |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/backend/pdf/ev-poppler.cc b/backend/pdf/ev-poppler.cc
index 554756f..0cb30ab 100644
--- a/backend/pdf/ev-poppler.cc
+++ b/backend/pdf/ev-poppler.cc
@@ -3198,6 +3198,22 @@ pdf_document_annotations_add_annotation (EvDocumentAnnotations *document_annotat
                                                     get_poppler_annot_text_icon (icon));
                        }
                        break;
+               case EV_ANNOTATION_TYPE_TEXT_MARKUP: {
+                       GArray *quads;
+
+                       quads = poppler_page_get_quadrilaterals_for_area (poppler_page, &poppler_rect, NULL);
+
+                       switch (ev_annotation_text_markup_get_markup_type (EV_ANNOTATION_TEXT_MARKUP 
(annot))) {
+                               case EV_ANNOTATION_TEXT_MARKUP_HIGHLIGHT: {
+                                       poppler_annot = poppler_annot_text_markup_new_highlight 
(pdf_document->document, &poppler_rect, quads);
+                               }
+                                       break;
+                               default:
+                                       g_assert_not_reached ();
+                       }
+                       g_array_unref (quads);
+               }
+                       break;
                default:
                        g_assert_not_reached ();
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]