Bugzilla (bugzilla.redhat.com) will be under maintenance for infrastructure upgrades and will not be unavailable on July 31st between 12:30 AM - 05:30 AM UTC. We appreciate your understanding and patience. You can follow status.redhat.com for details.
Bug 879388 - Clickable links to different parts of a book do not work properly in PDF files
Summary: Clickable links to different parts of a book do not work properly in PDF files
Alias: None
Product: Publican
Classification: Community
Component: publican
Version: future
Hardware: Unspecified
OS: Unspecified
Target Milestone: 3.1
Assignee: Jeff Fearn ๐Ÿž
QA Contact: tools-bugs
: 890641 903742 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2012-11-22 19:28 UTC by Jaromir Hradilek
Modified: 2013-02-06 03:40 UTC (History)
6 users (show)

Fixed In Version: 3.1.0
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-02-06 03:40:43 UTC

Attachments (Terms of Use)

Description Jaromir Hradilek 2012-11-22 19:28:48 UTC
Description of problem:
When a book is built in the PDF format, clicking cross-references to different parts of the book does not work properly and often skips to a wrong page.

Version-Release number of selected component (if applicable):
publican and wkhtmltopdf in Brew

How reproducible:

Steps to Reproduce:
1. Open the following PDF file in a document viewer of your choice:


2. In the PDF document, open page number 4 with the Table of Contents.

3. Click chapter 2, โ€œBefore Configuring the Red Hat High Availability Add-Onโ€.

Actual results:
The PDF viewer skips to the beginning of page 24, that is, to the middle of section 2.5.3., โ€œDisabling ACPI Completely in the grub.conf Fileโ€.

Expected results:
The PDF viewer should skip to the beginning of page 17 where chapter 2 starts.

Additional info:
Verified on Fedora 17 with both Evince and Okular.

Comment 1 Ruediger Landmann 2012-11-22 23:36:02 UTC
A fresh build of the doc with publican-3.0.0-0.fc17.noarch shows the same problem

Comment 2 Jeff Fearn ๐Ÿž 2012-11-25 23:09:23 UTC
We need to switch from the TOC DocBook generates to a wkhtmltopdf specific TOC.

Comment 3 Jeff Fearn ๐Ÿž 2013-01-14 07:15:35 UTC
I've switched the code to use wkhtmltopdf to generate the TOC, so the TOC now functions correctly, and has page numbers!

However the upstream bug โ€‹http://code.google.com/p/wkhtmltopdf/issues/detail?id=411 means that XREFs will still point to the wrong spot to large blocks.

This fix has been committed to the devel branch for inclusion in Publican 3.1.

I will be looking in to the upstream bug and seeing if I can patch wkhtmltopdf so the links work as expected.

Comment 4 Jeff Fearn ๐Ÿž 2013-01-23 09:26:56 UTC
*** Bug 890641 has been marked as a duplicate of this bug. ***

Comment 5 Jeff Fearn ๐Ÿž 2013-01-24 00:25:20 UTC
OK so I've tracked down why this happens, but couldn't fix the PDF directly so I have a workaround in place.

When linking to an object the landing site for a link is the middle of the rectangle for the object. Since publican puts the IDs in the  DIV surrounding an object this means that the PDF landing site will be the middle of the section, chapter, table, etc. My workaround was to revert the change in ID location so that IDs are now placed on the title element, giving a much smaller rectangle to land on.

This may not fix links to all elements, but it will cover most and any other elements should have their own bugs opened.

This fix has been committed to the devel branch for inclusion in Publican 3.1.

Comment 6 Ruediger Landmann 2013-01-25 04:18:30 UTC
*** Bug 903742 has been marked as a duplicate of this bug. ***

Comment 7 xuezhi ma 2013-01-28 08:10:46 UTC
Verify version:publican-3.1.0-0.el6eng

Verify steps:
1. Get source file that can be built into the wrong PDF documment in publican 3.0.
2. Rebuilt the document with publican 3.1.
3. In the PDF document, open page with the Table of Contents, click each cross-references.

Actual result:
Every cross-references can be clicked and skip to correct page(it will skip to the beginning of each relative parts of the document).

Note You need to log in before you can comment on or make changes to this bug.