[poppler] pdf file whose index has no link
Albert Astals Cid
aacid at kde.org
Mon Apr 17 12:22:47 PDT 2006
A Dilluns 17 Abril 2006 21:00, Vincent Torri va escriure:
> 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 ?
I already told you on IRC, that's possible.
links in the TOC can be named links that means you don't get a LinkDest but a
name (when using getNamedDest()) that you have to pass to PDFDof::findDest()
to get the real LinkDest.
It is also possible that a link from the TOC is not a actionGoTo but a
actionGoToR in that case, in addition to the above things, it means that
clicking on the link of the TOC has to open the file specified in
LinkGoToR::getFileName()
Albert
>
> Vincent
> _______________________________________________
> poppler mailing list
> poppler at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/poppler
______________________________________________
LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com
More information about the poppler
mailing list