Re: [evince] Help for accessing text annotations from libevview/libevdocument



On Thu, 2015-01-08 at 23:23 -0800, Germán Poo-Caamaño wrote:
On Sat, 2015-01-03 at 09:26 +0000, Richard Shann wrote:
I have battled on with this and now have this:

  gint i;
  for (i=0; i< ev_document_get_n_pages(doc);i++)
    {
     EvMappingList *mapping_list = ev_document_annotations_get_annotations (doc, 
ev_document_get_page(doc, i));
     if(mapping_list)
        {
        GList *g = ev_mapping_list_get_list (mapping_list);
        for (;g;g=g->next) {
            
            EvMapping *mapping = g->data;
            EvAnnotation *annot = mapping->data;
            g_print("Get %d %p %s", i, mapping->data, ev_annotation_get_contents (annot));
            
        }
        }
    }

This shows up a bug - 

#include <libdocument/ev-annotations.h>

is missing from the evince-document.h file.

Likely the annotations are not being exposed publicly

The function  ev_document_annotations_get_annotations() is in the
documentation, but its prototype is missing in the headers.

 (I have not
checked the source code, but it might be possible).  Possibly because
nobody has used that API before.

Please file a bug,

I would have to find out how to do that, which would seem overkill for a
trivial omission of an include.
As the documentation is mostly stubs (e.g. there is nothing about what
the data returned by ev_mapping_list_get_list contains) I guess this is
just work in progress, not really at the bug finding stage of
development.

I'm pleased to say, however, that I have got the needed functionality
working (see
http://git.savannah.gnu.org/gitweb/?p=denemo.git;a=blob_plain;f=src/source/proof.c;hb=HEAD 
for the code that finds the annotation nearest the clicked external link
in a PDF document and passes its text to the link).

Richard





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