[Poppler-bugs] [Bug 102698] PDF bookmarks off by one

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Sep 13 11:01:54 UTC 2017


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

--- Comment #1 from Adrian Johnson <ajohnson at redneon.com> ---
Works fine for me with evince. If you turn off continuous mode it will select
the right page. If you turn on continuous mode it will appear to select the
wrong page. The reason is:

pdfinfo -dests test.pdf
Page  Destination                 Name
   1 [ XYZ   -0   31 null      ] "Doc-Start"
   1 [ XYZ   -0    9 null      ] "slide.1"
   2 [ XYZ   -0    9 null      ] "slide.2"
   3 [ XYZ   -0    9 null      ] "slide.3"
   4 [ XYZ   -0    9 null      ] "slide.4"

According to PDF32000 Table 151 the "XYZ" destination means:

[page /XYZ left top zoom]
"Display the page designated by page, with the coordinates (left, top)
positioned at the upper-left corner of the window and the contents of
the page magnified by the factor zoom. A null value for any of the
parameters left, top, or zoom specifies that the current value of that
parameter shall be retained unchanged. A zoom value of 0 has the
same meaning as a null value."

The above output shows left = 0 and top = 9 or 31. (0,0) is the bottom left of
the page. So left = 0, top = 9 is a point 0" from the left and 9/72" from the
bottom. When this point is positioned "at the upper-left corner of the window"
in continuous mode, almost all of the selected page is above the top of the
window and the next page will be visible.

If you want the selected page entirely visible you should specify a point at
the top of the page or use one of the other destination options.

The problems seems to be with the ps2pdf conversion. Looking at test.ps the
dests are:

SDict begin [/Count 0/Dest (slide.1) cvn/View [/XYZ null null null]/Title
(A) /OUT pdfmark end
 -600 6689 a -600 6689 a
SDict begin [/Count 0/Dest (slide.2) cvn/View [/XYZ null null null]/Title
(B) /OUT pdfmark end
 -600 6689 a -600
6689 a
SDict begin [/Count 0/Dest (slide.3) cvn/View [/XYZ null null null]/Title
(C) /OUT pdfmark end
 -600 6689 a -600 6689 a
SDict begin [/Count 0/Dest (slide.4) cvn/View [/XYZ null null null]/Title
(D) /OUT pdfmark end
 -600 6689 a -600 6689

ie the left, top is "null null". Which means "unchanged". But after conversion
to pdf the dest of the first bookmark is

"<</D [4 0 R /XYZ -0.269996643 8.50524902 null]>>endobj"

ie left = 0.26, top = 8.5 which is rounded to an integer the the pdfinfo
output.

I recommend using pdflatex instead of converting DVI to PS to PDF. You will get
much better quality output.

-- 
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/20170913/d52a3f41/attachment.html>


More information about the Poppler-bugs mailing list