Created attachment 136883 [details] 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ƈ
Created attachment 136884 [details] Test pdf file
Created attachment 136885 [details] Vala code Vala code compiled using valac --pkg poppler-glib --pkg gtk+-3.0 -o mini_linkmap mini_linkmap.vala
Created attachment 136886 [details] Test pdf latex source Compile using `pdflatex hyperlinks.tex`
Note also the garbage returned for the desttype enum.
Sorry, but for some reason Bugzilla failed to generate valid XML to export this bug when migrating to GitLab. As a result we've been unable to duplicate it there. Please file a new issue on https://gitlab.freedesktop.org/poppler/poppler/issues/new/ referencing this one. Thanks, and sorry again for the inconvenience.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.