Summary: | PDF bookmarks off by one | ||
---|---|---|---|
Product: | poppler | Reporter: | Tristan Miller <psychonaut> |
Component: | general | Assignee: | poppler-bugs <poppler-bugs> |
Status: | RESOLVED NOTOURBUG | QA Contact: | |
Severity: | normal | ||
Priority: | medium | CC: | psychonaut |
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: | Sample file showing bookmark bug |
Description
Tristan Miller
2017-09-13 08:49:23 UTC
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. (In reply to Adrian Johnson from comment #1) > I recommend using pdflatex instead of converting DVI to PS to PDF. You will > get much better quality output. Unfortunately, this is not an option when using certain LaTeX packages, such as powerdot or pstricks. > The problems seems to be with the ps2pdf conversion. OK, so I should report this problem to Ghostscript? (In reply to Tristan Miller from comment #2) > OK, so I should report this problem to Ghostscript? Yes. Ghostscript bug report: https://bugs.ghostscript.com/show_bug.cgi?id=698530 |
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.