[Poppler-bugs] [Bug 51974] New: Proper implementation of toc logic in the demo application

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Jul 11 05:09:46 PDT 2012


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

             Bug #: 51974
           Summary: Proper implementation of toc logic in the demo
                    application
    Classification: Unclassified
           Product: poppler
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: medium
         Component: qt4 frontend
        AssignedTo: poppler-bugs at lists.freedesktop.org
        ReportedBy: mj10777 at googlemail.com


Created attachment 64093
  --> https://bugs.freedesktop.org/attachment.cgi?id=64093
suggested extention of the toc functionality in the demo

In the qt4/demos the proper/comleate usage of the toc logic is not implemented,
although the class itself has prepared everything needed to be done.

In my opinion any pdf-viewer where the toc does not work is  useless.

In the documentation of toc() there is no real information of what
'Destination' contains and how it can be used:
"Destination: A string description of the referred destination"

In reality it is a array of values needed to set the page position of the toc.

Based on the code found at:
http://qt-apps.org/content/show.php/Pdf+Viewer?content=149637
PdfViewer (app + library)    0.6  

where the page position is retrieved with:
 // LinkDestination.toString(): 0=kind;1=PageNr as
int;2=left;3=bottom;4=right;5=top;6=zoom;7=changeLeft;8=changeTop;9=changeZoom
  QStringList
sa_LinkDestination_Values=e.attribute(QString::fromLatin1("Destination")).split(";");
  const double pageNumber =
sa_LinkDestination_Values[1].toDouble()+sa_LinkDestination_Values[5].toDouble();

a goToPage slot can be added, so that when the user double clicks the toc
entry, the pdf will go to that position.

Whereby now the demo does nothing - which is a bad demostration of the toc
usage.
What is the use of a toc if it cannot be used to go to the position one is
looking for.

When the submitted diff is applied, the demo will, when a pdf that has a toc
has been loaded and the user has clicked an entry, will move to that position.

I spent hours yesterday trying to figure out why the qt implementation did not
work, knowing very well that that poppler was not the cause.

A proper documentation of what 'Destination' returns and its usage as show
above would save others a lot of time.

Also when a demo runs where this basic functionality does not work, one could
assume that it is not implemented and look further to find something that does
work.
But in reality it is implemented - only the last step is not.

For these reasons I request that the diff be applied.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list