Bug 51974 - [PATCH] Proper implementation of toc logic in the demo application
Summary: [PATCH] Proper implementation of toc logic in the demo application
Status: RESOLVED INVALID
Alias: None
Product: poppler
Classification: Unclassified
Component: qt4 frontend (show other bugs)
Version: unspecified
Hardware: All All
: medium enhancement
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-11 05:09 UTC by Mark Johnson
Modified: 2014-02-18 23:28 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
suggested extention of the toc functionality in the demo (2.31 KB, patch)
2012-07-11 05:09 UTC, Mark Johnson
Details | Splinter Review

Description Mark Johnson 2012-07-11 05:09:46 UTC
Created attachment 64093 [details] [review]
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.
Comment 1 Albert Astals Cid 2012-07-22 18:25:34 UTC
this is a demo, not a pdf viewer :D
Comment 2 Albert Astals Cid 2012-07-22 18:30:25 UTC
On the other hand you are only adding support for "Destination", what about "DestinationName" or "Open" or "ExternalFileName"?
Comment 3 Albert Astals Cid 2012-12-28 11:51:42 UTC
Mark? any followup on my comments?
Comment 4 Albert Astals Cid 2014-02-18 23:28:13 UTC
No followup


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.