[Poppler-bugs] [Bug 104718] New: Cannot obtain linkmapping information in python/gjs

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Jan 21 20:00:22 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=104718

            Bug ID: 104718
           Summary: Cannot obtain linkmapping information in python/gjs
           Product: poppler
           Version: unspecified
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: glib frontend
          Assignee: poppler-bugs at lists.freedesktop.org
          Reporter: m.duell at gmx.de

Created attachment 136883
  --> https://bugs.freedesktop.org/attachment.cgi?id=136883&action=edit
Python Code

Cannot obtain information about hyperlinks on the current page using python. 

This might also be a problem with the GLib bindings. The problem appears also
using gjs bindings (will not post here unless specifically required), but with
C and vala it appears to work correctly.

I attach a test pdf, generated using latex with a few hyperlinks and
inner-document links.

With the attached vala code, I get the following output.


$ ./mini_linkmap
gotodest: 5
link: area: 158.232000 321.926000 290.983000 333.051000
link: 5 t: (null) u: https://gitlab.gnome.org/GNOME/pygobject
link: area: 398.028000 333.605000 478.476000 345.560000
link: 5 t: (null) u: https://gitlab.gnome.org/GNOME/pygobject
link: area: 258.578000 353.530000 427.942000 365.485000
link: 5 t: (null) u: https://poppler.freedesktop.org/
link: area: 132.772000 408.573000 218.450000 419.698000
link: 5 t: (null) u: https://poppler.freedesktop.org/
link: area: 392.798000 420.529000 478.476000 431.653000
link: 5 t: (null) u: https://poppler.freedesktop.org/
link: area: 435.948000 446.653000 442.922000 455.066000
   dest type 2 page 0 a: 0.000000 0.000000 0.000000 0.000000 z: 0.000000 n:
cite.Random 
link: area: 383.416000 511.438000 390.390000 522.286000
   dest type 2 page 0 a: 0.000000 0.000000 0.000000 0.000000 z: 0.000000 n:
section.1 


The python code should give a similar output. However, The URI strings are
returned empty.

$ ./mini_linkmap.py crash2
link: area: 158.232000 321.926000 158.232000 333.051000
action type: uri
title: None
uri: ''
link: area: 398.028000 333.605000 398.028000 345.560000
action type: uri
title: None
uri: ''
link: area: 258.578000 353.530000 258.578000 365.485000
action type: uri
title: None
uri: ''
link: area: 132.772000 408.573000 132.772000 419.698000
action type: uri
title: None
uri: ''
link: area: 392.798000 420.529000 392.798000 431.653000
action type: uri
title: None
uri: ''
link: area: 435.948000 446.653000 435.948000 455.066000
action type: 2 goto_dest page 0 a: (0.0, 0.0, 0.0, 0.0) z: 0.0 dest type: <enum
31335872 of type Poppler.DestType>
link: area: 383.416000 511.438000 383.416000 522.286000
action type: 2 goto_dest page 0 a: (0.0, 0.0, 0.0, 0.0) z: 0.0 dest type: <enum
31337472 of type Poppler.DestType>




If the goto_dest named_dest string is queried, even the python interpreter
crashes most times and sometimes yields garbage.

$ ./mini_linkmap.py crash
link: area: 158.232000 321.926000 158.232000 333.051000
action type: uri
link: area: 398.028000 333.605000 398.028000 345.560000
action type: uri
link: area: 258.578000 353.530000 258.578000 365.485000
action type: uri
link: area: 132.772000 408.573000 132.772000 419.698000
action type: uri
link: area: 392.798000 420.529000 392.798000 431.653000
action type: uri
link: area: 435.948000 446.653000 435.948000 455.066000
action type: 2 goto_dest page 0 a: (0.0, 0.0, 0.0, 0.0) z: 0.0 dest type: <enum
28583360 of type Poppler.DestType>
**
ERROR:../../gi/pygi-argument.c:1004:_pygi_argument_to_object: code should not
be reached
Aborted

Example of random garbage:

$ ./mini_linkmap.py crash
link: area: 158.232000 321.926000 158.232000 333.051000
action type: uri
link: area: 398.028000 333.605000 398.028000 345.560000
action type: uri
link: area: 258.578000 353.530000 258.578000 365.485000
action type: uri
link: area: 132.772000 408.573000 132.772000 419.698000
action type: uri
link: area: 392.798000 420.529000 392.798000 431.653000
action type: uri
link: area: 435.948000 446.653000 435.948000 455.066000
action type: 2 goto_dest page 0 a: (0.0, 0.0, 0.0, 0.0) z: 0.0 dest type: <enum
24778176 of type Poppler.DestType>
title: None n: 0ƈ
link: area: 383.416000 511.438000 383.416000 522.286000
action type: 2 goto_dest page 0 a: (0.0, 0.0, 0.0, 0.0) z: 0.0 dest type: <enum
24779840 of type Poppler.DestType>
title: None n: 0ƈ

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20180121/3a5f7e97/attachment.html>


More information about the Poppler-bugs mailing list