Bug 192032 - Cross-document hyperlinks do not find the right page
Summary: Cross-document hyperlinks do not find the right page
Status: RESOLVED FIXED
Alias: None
Product: okular
Classification: Applications
Component: general (show other bugs)
Version: 0.8.2
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-05-08 13:55 UTC by Claus Appel
Modified: 2009-05-13 16:29 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Two PDF documents with cross-document links. (12.22 KB, application/x-tar)
2009-05-08 13:56 UTC, Claus Appel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Claus Appel 2009-05-08 13:55:24 UTC
Version:           0.8.2 (using 4.2.2 (KDE 4.2.2), 4.2.2-12.fc10 Fedora)
Compiler:          gcc
OS:                Linux (i686) release 2.6.27.21-170.2.56.fc10.i686

PDF documents support cross-document hyperlinks: A hyperlink in one document can lead to another document. Clicking it will bring up the other document. 

Okular supports this, but with a bug: When clicking a cross-document hyperlink, Okular will correctly open the new document but will not hop to the correct page. It just stays on page one. 

Attached are two PDF files documenting the bug: xr01.pdf contains two hyperlinks to xr02.pdf. Clicking the reference to "page 2" sends the viewer to page 1 of xr02.pdf. (Try opening up the documents in Evince instead of Okular to see the correct behaviour.)
Comment 1 Claus Appel 2009-05-08 13:56:53 UTC
Created attachment 33465 [details]
Two PDF documents with cross-document links.

Two PDF documents with cross-document links. The link to "page 2" works in Evince, but not in Okular.
Comment 2 Pino Toscano 2009-05-09 02:23:03 UTC
Confirm.
This happens because in case of GoTo actions referring to an external file/document, we just request KDE to open the default handler for the document (basing on its file type); this has the disadvantage that we ignore the associated target information for the newly open document.
I see two possible solutions for the problem:
1) use the "PDF Open Parameters" syntax by extending the document URL; I'm not sure how well could be received by other programs though
2) instead of invoking the default KDE handler for the external file, check whether can be handled by Okular and in case open in a new Okular window; could not respect KDE settings for mimetypes though
(other ideas?)
Comment 3 Pino Toscano 2009-05-09 18:11:12 UTC
Ahh no, please scratch what I said above.

The reason is that the "GoTo" actions in the test document specify the destination in the target document with a "named" destination, which poppler(-qt4) tries to resolve in the local document (failing), and thus giving no destination.
Comment 4 Pino Toscano 2009-05-13 16:24:32 UTC
SVN commit 967542 by pino:

Add the concept of "next destination" next to the "next viewport" one.
This allows a resolution, if set, of that named destination when opening a document.
CCBUG: 192032


 M  +28 -4     document.cpp  
 M  +7 -0      document.h  
 M  +2 -0      document_p.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=967542
Comment 5 Pino Toscano 2009-05-13 16:29:27 UTC
The remaining part of the fix is in the Poppler library (which we use for PDF documents), and in its Okular backend.
Unfortunately, this means waiting for Poppler 0.12 (which will be released in two months), and that Okular's distro package is recompiled against that new version.