Bug 305592 - pdf links generated with hyperref latex package do not work
Summary: pdf links generated with hyperref latex package do not work
Status: RESOLVED NOT A BUG
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 0.15.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-22 11:52 UTC by Cássio
Modified: 2015-11-17 20:41 UTC (History)
6 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
tex file (190 bytes, text/x-tex)
2012-08-22 12:47 UTC, Cássio
Details
pdf file with links not working in okular (35.55 KB, application/octet-stream)
2012-08-22 12:48 UTC, Cássio
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cássio 2012-08-22 11:52:08 UTC
After generating a pdf via latex using the hyperref package the links do not work within okular.

Reproducible: Always

Steps to Reproduce:
1. Generate a document using hyperref, example below:

-- cut here ---
\documentclass[a4paper]{article}
\usepackage{hyperref}

\begin{document}

\title{Test}

\maketitle

\section{Section 1}
\label{sec:1}

\section{Section 2}

Test \ref{sec:1}.

\end{document}
--- cut here ---

2. compile with pdflatex article.tex && pdflatex article.tex

3. open article.pdf with okular
Actual Results:  
links do not work

Expected Results:  
links should move the reader to the specified link.

I think this is a bug in okular because if I open the exact same pdf in evince the links are working.
Comment 1 Albert Astals Cid 2012-08-22 12:45:35 UTC
Attach the file please
Comment 2 Cássio 2012-08-22 12:47:59 UTC
Created attachment 73381 [details]
tex file
Comment 3 Cássio 2012-08-22 12:48:59 UTC
Created attachment 73382 [details]
pdf file with links not working in okular

Here's the pdf in which the link does not work in okular.
Comment 4 Albert Astals Cid 2012-08-22 12:52:55 UTC
Works here, which poppler version are you using?
Comment 5 Cássio 2012-08-22 12:55:02 UTC
[cassio@arch ~]$ pacman -Q poppler
poppler 0.20.3-1
Comment 6 Oliver Sander 2012-08-22 15:08:19 UTC
I have been having the same problem for a while now.  Don't know when it started.  I  am using poppler and okular from git head.
Comment 7 Oliver Sander 2012-08-22 20:13:56 UTC
I did a few more tests.  Hyperlinks don't work with my distribution's (Debian Testing) poppler and okular either.  I see the red and green boxes around the link, but the cursor doesn't change while hovering over them, and clicking doesn't do anything either.
Hyperlinks do work in evince, though, so I guess it is not a poppler issue.

Could this be something in my distribution?  Say a bug in one of the Debian qt packages?
Comment 8 Cássio 2012-08-22 20:16:25 UTC
Oliver,

I don't think it's specific to your distribution, as I'm running Arch Linux. Maybe it's a combination of the poppler and okular versions we're running.

The pdf works fine in evince here too.
Comment 9 Luigi Toscano 2012-08-22 20:37:13 UTC
It does work for me.

When I click on the [1] in the line with "Test [1]", the page view scrolls in a way that "Section 1" is at the top of the page.

Tested with:
- the attached PDF and a PDF compiled from the tex (tex->dvi->pdf) on Debian testing (KDE SC 4.8.4, Okular 0.14.3, poppler 0.18.4)
- the attached PDF on Fedora 16 (KDE SC 4.8.5 and that version of Okular, poppler 0.18 iirc, can't check now)
Comment 10 Cássio 2012-08-22 20:41:31 UTC
@Luigi,

I think this is a new bug. I'm running okular 0.15.0 with KDE 4.9.00 and poppler 0.20.3
Comment 11 Oliver Sander 2012-08-22 20:44:18 UTC
I got it fixed for me.  No bug, apparently I screwed something up mixing KDE stuff from Debian with handcompiled stuff.  When I really(!) removed all my hand-compiled code the links started working again.
(that's okular 0.14.3).  Sorry for the noise.
Comment 12 Albert Astals Cid 2012-08-22 20:53:20 UTC
I'm betting that's what happens to Cássio to since i'm using 0.15.0 and 0.20.3 too with no problem. I will try to get my arch machine updated, but it's been a while and it complains a lot when trying to update
Comment 13 Cássio 2012-08-22 20:59:15 UTC
@Albert,

Sorry, I haven't mixed any self-compiled code with kde packages. I haven't messed with any packages in that way.

At the time of this post my machine is fully up to date.

I'm using the standard Arch kde, okular and poppler packages. It might be a bug introduced on those packages.

Other than that I don't see how something I did could have produced these results.

Let me know if I can provide any additional info.
Comment 14 Albert Astals Cid 2012-08-22 22:52:29 UTC
I just upgraded my arch installation and it works fine there too.

Question, are you using "trim margins"?

Can you
ldd /usr/lib/poppler.so.27
ldd /usr/lib/poppler-qt.so.4
ldd /usr/lib/kde4/okularGenerator_poppler.so
Comment 15 Cássio 2012-08-23 11:53:20 UTC
@Albert:

Thanks for looking into this.

I figured it out. My "text selection" button was activated, that causes links to not work. If I return to "Browse" then the links work. Sorry for causing the inconvenience. 

Still, I don't understand why links are disabled if you are in text selection mode. Is this a bug or a design decision?
Comment 16 Albert Astals Cid 2012-08-23 14:36:06 UTC
Design decision
Comment 17 Marc Wäckerlin 2013-04-09 07:44:53 UTC
A really stupid and unintuitive design decision! Should be reverted to «works as expected»!
Comment 18 Marc Wäckerlin 2013-04-09 07:50:01 UTC
(In reply to comment #17)
> A really stupid and unintuitive design decision! Should be reverted to
> «works as expected»!

As you see, a lot of people, including me, have a lot of trouble with this «design decision». Normally I am browsing all the PDFs in text-selection, because it is normal to me to here and there copy some text.

Before googling around and reading all through this ticket, I had no idea what the problem could be.

That's absolutely not how software should work! Software should be intuitive and work as expected.

The bare minimum is to show some kind of infomation, such as: «Hyperlinks are disabled due to text selection mode.»
Comment 19 Albert Astals Cid 2013-04-09 08:02:57 UTC
Learn to use bugzilla. If you have a wish, open a bug report and expose that wish. Reopening a bug that says "pdf links generated with hyperref latex package do not work" is silly, because they do work.
Comment 20 Marc Wäckerlin 2013-04-09 08:18:05 UTC
Ok, I opened a new report, see https://bugs.kde.org/show_bug.cgi?id=318078
Comment 21 Albert Astals Cid 2013-04-09 08:22:41 UTC
Stop reopening this bug.
Comment 22 basu123ra 2014-02-14 08:06:37 UTC
Leaving the blames if it is a design decision or something else, I support that when I read a (LaTeX) pdf, the 90% of time is in "Text selection mode". I know that there are technique reasons to enable hyperlinks only in "Browse mode", but maybe the Okular team could reconsider it. 

I mean, Evince is a very simple pdf viewer, but it makes the job good enough.
Comment 23 Theresa 2015-11-17 20:41:42 UTC
I agree with all of you! And thanks for the hint with "browse" mode. I'm constantly in "Text selection mode" and this "feature" just cost me at least half an hour of googeling and checking package versions. I thought I was missing a LaTex package or so...instead it's a feature of Okular...