koreader / kindlepdfviewer

(DEPRECATED, please use KOReader instead) A PDF (plus DJVU, ePub, TXT, CHM, FB2, HTML...) viewer made for e-ink framebuffer devices, using muPDF, djvulibre, crengine
GNU General Public License v3.0
498 stars 98 forks source link

Switching between STANDARD and KOPTReader. #465

Closed tigran123 closed 11 years ago

tigran123 commented 11 years ago

As this seems to be a complex topic I am creating a separate discussion issue for it (with a new label too :)

To start off the discussion here is a very simple implementation of the toggle on filechooser.lua level that is currently in my kopt-switch branch:

https://github.com/tigran123/kindlepdfviewer/compare/master...kopt-switch

Now, I am not proposing to merge this into master --- this is just a "zeroth approximation" and I understand that @chrox is offering something much more sophisticated and flexible. So, this is just the starting point for the discussion, to allow @chrox and others specify clearly what extra features compared to this "zero level" they are offering and how they propose to implement them.

houqp commented 11 years ago

Will be better if we can automatically reopen the file with the new reader when user pressed R. I have heard that the typesetting of kpdfopt is good enough for most of the cases. But there will still be the cases when kpdfopt does not work. Then the user will want to quickly switch back to the original reader, checkout the original page and switch back.

tigran123 commented 11 years ago

@houqp First of all, it is certainly NOT "good enough for most of the cases". Namely, as I said before, for most cases it is not appropriate (I estimate to be 95% but this estimate is specific to my set of about 1,000,000 books to do with Bible, Philosophy, History, Fiction, Physics, Mathematics, Programming that I have either published myself or collected in the past 25 years --- why I mention that this estimate is specific to my collection? Because, naturally, my collection has only the best books, i.e. it doesn't include some primitive text-only A4/USletter PDF files generated directly from websites and such --- it has only proper books (or manuscript facsimiles) scanned or typeset). But for the remaining 5% of books which the standard PDF/DjVu KPV reader has trouble viewing, the new KOPTReader is quite good (though not perfect yet, there are still critical bugs that make parts of the text inaccessible) and even invaluable, i.e. without it we just can't read them and with it we can read them. This is the proper assessment of KOPTReader usability at present. I praised KOPTReader highly on the-ebook.org forum and I stand by my words --- the above assessment doesn't change them, because, I repeat, for some (small) group of books it is a very powerful and useful tool indeed. And its approach of image analysis is unique and more powerful/fruitful than the standard text extraction reflow used by Adobe and others.

As for your suggestion, yes, I agree that it would be very good if we could provide R command inside PDF, DjVu and KOPT reader (let's call the standard ones just PDF and DjVu readers, and the new one KOPT reader) which closes the file and re-opens it with the alternative reader. And the settings is saved on a per-file basis in the file's history file.

tigran123 commented 11 years ago

I will play with closing/re-opening file and see if it can be done comfortably in the current framework...

tigran123 commented 11 years ago

Btw, currently Home is described in the help as Exit application (from within a reader), but it behaves in exactly the same way as Alt-Back (close the document) because changing the global variable keep_running has no effect --- the inputLoop() uses a local keep_running anyway (and it is useless there as it is never changed).

So, how about we remove the Home key from the reader and use only Alt-Back to close the document, reserving Home only for quitting the whole KPV application from filechooser level? Or would you prefer to fix Home to work as intended (i.e. exit application) from the reader level as well?

tigran123 commented 11 years ago

A sample implementation of the switch is in the PR #474.

I had to use Alt-R rather than R because the latter is already used for setting DjVu rendering mode. Besides, Alt-R is more suitable because it reads like "alternative reader" which matches the command's function.

tigran123 commented 11 years ago

The current preferred implementation is in the PR #480 so one should look there for the relevant discussion. Closing this issue now.