Bug 370949 - PDF bookmarks off by one
Summary: PDF bookmarks off by one
Status: RESOLVED UPSTREAM
Alias: None
Product: okular
Classification: Applications
Component: PDF backend (show other bugs)
Version: 0.26.0
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Okular developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-16 11:04 UTC by Tristan Miller
Modified: 2017-09-13 13:06 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Sample file showing bookmark bug (14.56 KB, application/x-pdf)
2016-10-16 11:04 UTC, Tristan Miller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tristan Miller 2016-10-16 11:04:26 UTC
In some PDF documents (in particular, those produced with the LaTeX Powerdot class using a certain page size), the internal page bookmarks are all off by one.  Take the attached document as an example.  Regardless whether you use the document's own hyperlinks in the left-hand column of the page, or okular's built-in table of contents, clicking on "A" takes you to slide "B", "B" takes you to slide "C", and "C" takes you to slide "D".

This problem also occurs when viewing the document with Evince, but not when using Adobe Acrobat Reader DC.  Is it possible the problem is with Poppler, then?  (If so, any ideas as to what in Poppler is causing it?  I can file an upstream bug report if necessary, but it would help if I could provide further details.)

Reproducible: Always

Steps to Reproduce:
1. Open the attached document test.pdf and click on the "A", "B", or "C" links in the left-hand column of the page or in Okular's table of contents.


Actual Results:  
2. Clicking on "A" takes you to slide "B", "B" takes you to slide "C", and "C" takes you to slide "D".

Expected Results:  
2. Clicking on "A" should take you to slide "A", "B" to slide "B", and "C" to slide "C".

The document was created using an up-to-date TeX Live 2016 system and Ghostscript 9.19's ps2pdf:

$ cat >test.tex
\documentclass[paper=smartboard]{powerdot}
\listfiles
\begin{document}
\begin{slide}{A}\end{slide}
\begin{slide}{B}\end{slide}
\begin{slide}{C}\end{slide}
\begin{slide}{D}\end{slide}
\end{document}

$ latex test;latex test;dvips test;ps2pdf test.ps
$ okular test.pdf

The problem may have something to do with the page size. The problem does not occur when "smartboard" is changed to "screen", "a4paper", or "letterpaper".  Looking at the Powerdot source code, it doesn't seem that Powerdot itself uses the page size to determine how the bookmarks are set.
Comment 1 Tristan Miller 2016-10-16 11:04:44 UTC
Created attachment 101582 [details]
Sample file showing bookmark bug
Comment 2 Gilbert Assaf 2017-04-07 12:11:03 UTC
I can reproduce this problem, with current Master. But I think it's a Bug in poppler. I also tested it with various other pdf readers:

Okular: Bookmarks are off by one
Firefox: Same Problem
Evince: Same Problem
Chromium: Works fine
Adobe Reader: Works fine
Comment 3 Nate Graham 2017-09-13 04:17:26 UTC
Yes, please report against poppler: https://bugs.freedesktop.org/enter_bug.cgi?product=poppler
Comment 4 Tristan Miller 2017-09-13 08:49:43 UTC
Upstream bug report: https://bugs.freedesktop.org/show_bug.cgi?id=102698
Comment 5 Tristan Miller 2017-09-13 13:06:04 UTC
The Poppler developers claim this is a bug with Ghostscript, wither I have reported it: https://bugs.ghostscript.com/show_bug.cgi?id=698530