[poppler] pdf file whose index has no link

Vincent Torri vtorri at univ-evry.fr
Mon Apr 17 12:00:10 PDT 2006


On Mon, 17 Apr 2006, Leonard Rosenthol wrote:

> At 02:25 PM 4/17/2006, Vincent Torri wrote:
>> whose index has no "destination". More precisely, if action is an action,
>
>        What do you mean by "index" in this case?
>
>        there are LOTS of destinations and actions in that PDF - please 
> identify by object ID.

ha, ok. Here is what I do : If doc is a PDFDoc *

GooList    *gitems = document->pdfdoc->getOutline ()->getItems ();

With tat GooList, I fill an Ecore_List (the list that I use in my library) 
with data of type :

struct _Epdf_Index_Item
{
   char       *title;
   LinkAction *action;
   Ecore_List *children;
};

with that function :

static void
epdf_index_fill (Ecore_List *items,
                  GooList    *gitems)
{
   if (!items || !gitems)
     return;

   for (int i = 0; i < gitems->getLength (); i++) {
     Epdf_Index_Item *item;
     OutlineItem *oitem = (OutlineItem *)gitems->get (i);
     Unicode *utitle = oitem->getTitle ();

     item = epdf_index_item_new ();
     item->title = unicode_to_char (utitle, oitem->getTitleLength ());
     item->action = oitem->getAction ();
     oitem->open ();
     if (oitem->hasKids () && oitem->getKids ()) {
       item->children = ecore_list_new ();
       epdf_index_fill (item->children, oitem->getKids ());
     }
     ecore_list_append (items, item);
   }
}

Then, I try to get the page number associated to a specific item :

LinkDest *dest = ((LinkGoTo *)item->action)->getDest ();

and that dest variable is NULL

Is it sufficient ?

Vincent


More information about the poppler mailing list