This repository has been archived by the owner on Sep 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove page number checking in displaying TOC
Former showTOC() method checks the page number in each entry and only display entry whose page number is greater than the previous one. However, I think this is too "clever", we should better leave the TOC untouched to keep consistent with other pdf readers.
- Loading branch information
Showing
2 changed files
with
6 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c8f87d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I proposed that check because in my case, on a book that I have, the TOC without that check was rendered incorrectly (probably it was corrupted in the PDF itself). I got something like:
and consider that clicking on items
Chapter 3
orChapter 4
I got redirected to page 1 of the document (because probably the items don't have an associated page number), while clicking on paragraph items the behaviour is correct. In this case, including the check of previous item page number, the above TOC is renderer correctly:I don't know if this just something happening on that specific book (and of course in that case it's not relevant at all), or it's something more generic (and in that case such a fix may be useful).
c8f87d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does other pdf readers in your PC also behaviors the same? It is likely to be a corrupted TOC in your PDF file. TOC entries are stored in PDF files as text stream, so you can check this out by opening the PDF file with any text editor. Usually, TOC entries locate at the bottom of the file.
I removed this check because eLiNK reports that in one of his book, kpdfview only displays part of the TOC. I checked his file and it does have a corrupted TOC which has crossed page number. Can you give me your E-Mail address so I can send that file to you for testing? Mine is at https://github.com/houqp :-)
See if we can bring out a patch that fixes both situation.
c8f87d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi, I checked out the TOC of my book, and in fact it's corrupted also on my PC viewer (I didn't check this, before), in the sense that you see exactly what you see on TOC of kpdfview. So no need to keep it into account.
Maybe the only improvement we may include is that, in case of "wrong items" in TOC, that don't have a page number attached, we don't go to page 0 by default (i.e. first page), but let that row to be sort of disabled (for instance: skipped during navigation of TOC).
I also added my email address on my profile on github.
Maybe, for testing purposes, could be a nice idea of collecting some "problematic" media documents (PDF and DJVU files having problem with: long loading times; memory issues; problems on TOC or rendering); of course, just not-copyrighted documents.
c8f87d5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree with that. I have sent you the file in case you want to work on that :)
Yes, any suggestion for places to share these files?
EDIT: I added a new issue for it #69