![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
KPV: a PDF reader for Kindle, based on muPDF, GPLv3
Hi,
(hidden OP text, since it has only historic value now ![]() Spoiler:
This is a document reading application for (jailbreaked) Kindles. It will probably be useless for now on the Kindle 4 (Non-Touch) version. It is basically directed at Kindle 3 (or Kindle Keyboard), Kindle DX(G) and maybe (untested) Kindle 2. For touch based devices, have a look at the successor, KOReader: https://www.mobileread.com/forums/sho...d.php?t=209276 It brings its own file browser and comes bundled with a script for the "launchpad" utility. Despite its name kindlepdfviewer, it supports a lot of document formats. Features: PDF and DJVU reading with support for table of contents, arbitrary zooming, fit to page content, gamma correction plus a bunch of other features. Also supported are XPS, CBZ (but not CBR, sorry), and thanks to CREngine also text-based formats FB2, TXT, HTML, RTF, CHM, MOBI, EPUB. The software is still under development. Nevertheless, please report bugs you may encounter (but check the latest discussion here in the thread to avoid duplicates). Also, you're very much invited to get your own hands dirty on the code. It's open source and the development happens mainly on github. After I started it in a humble proof-of-concept version, dpavlin, dave2008, germanc, traycold, NuPogodi and others made great contributions and it's a reader that's now really useful. For more information, relate to this thread - and the overview in the wiki: https://github.com/koreader/kindlepdfviewer/wiki So for the brave, here it is:
Basic installation / update (with launchpad):
Basic installation / update (with Kite)
Uninstallation: Please note that uninstallation is not needed when updating the application. Just install a newer release ZIP as described above (unless otherwise mentioned). But if you want to remove it for good, this is the procedure:
Known problems:
For the current release, have a look at the Download page: https://github.com/koreader/kindlepd.../wiki/Download Last edited by hawhill; 03-26-2013 at 03:58 PM. Reason: new repository locations, koreader |
![]() |
![]() |
![]() |
#2 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45
Karma: 10842
Join Date: Aug 2010
Device: Kindle DXG
|
Hi,
that's great news ![]() This weekend I made some quick experiments with muPDF and poppler to measure how fast they render the pages. I've used pdfdraw(mupdf) and pdftoppm(poppler). In both cases modifications were made in order to measure only the rendering time and to exclude the time needed to write the image to the flash drive. It looks like muPDF is twice as fast as poppler. About the mupdf rendering problem that I've told you about in a previous(OT) post, it turns out to be introduced in a relatively recent commit and reverting to an older revision(28e88083d782eb) does work as it should. The people at Freenode's #ghostscript channel seem to be quite responsive too. So I completely agree with your choice of PDF rendering library. I admit I know nothing about Lua, except what I am hearing about it - that it is minimalistic and fast(for a scripting language). Are you planning to use it just for a quick prototyping or you think it should be part of the end product too? What library you plan to use for the UI? I still think Qt would be a great choice if we can make it fast enough. I still haven't have the time to play with it, but I intend to do it. In my opinion using a tested and mature UI toolkit could be a big advantage. I don't have a previous experience with Qt but I think it can be quicker and more pleasant if we are able to develop the application on a desktop using the virtual framebuffer features of Qt(qvfb). |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
Yes, I did only use Lua for prototyping right now. Your characterization is quite right: it's lightweight. I would not say "fast", though, but that's a relative term anyway. It's easy to interface from C code (I would even go as far as saying it's fun to do so).
I think you can get a quick impression of it by looking at the "reader.lua" file. As for the UI, I always found Qt to be a bit sluggish. So I was even thinking of implementing my own UI. I'm not too sure about that, however, since it would definitely be more work than just relying on Qt standard dialogues. Qt/qvfb would also be indeed a great help. Thanks for the tipp regarding the muPdf problem in newer revisions. I'll have a look at it. Edit/Addendum: Hm, maybe integrating it into CoolReader would be an option. I'll have a look at it. However, there doesn't seem to be an up to date source code dump available right now. It's based on Qt. Last edited by hawhill; 11-15-2011 at 09:18 AM. |
![]() |
![]() |
![]() |
#4 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45
Karma: 10842
Join Date: Aug 2010
Device: Kindle DXG
|
Today I've had a little time to try your viewer. It works very well and is fast indeed. Even the gamma calculation, which as I understand from the commit log implies some performance penalty, doesn't seem to cause a noticeble slowdown. Are you working on zooming and scrolling already? Say something like shift+FiveWay_UP to scale up the document with 30% and alt+FW_UP to scale up with 5% ...?
Perhaps I can help with this, but I will need some time to familiarize myself with Lua and the codebase as a whole and I don't know if I will have enough free time this week. About the GUI I still haven't made any experiments with Qt but I think that there should be a way to draw on the framebuffer without performance loss for example using QDirectPainter or even a more direct(hacky) way if needed. After all we are providing the screen driver plugin. What I want to try is to use some kind of direct rendering for the pages, and return the control to Qt to visualize the dialogs. This way even if the painting of the dialogs is somewhat sluggish it won't affect the user experience most of the time. Last edited by vdp; 11-17-2011 at 08:58 AM. |
![]() |
![]() |
![]() |
#5 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
Well, a lot of its speed it currently gains from a simple caching strategy. It will always render the next page just after displaying the current one.
I think starting on zooming and navigation will be the next thing I'll tackle. I will have to revise the caching mechanism and policy for that, I think. Also I'd like to include support for muPDFs "bbox" device that will calculate a "real usage" dependent bounding box for a given page which would allow for cut-to-content feature (the efficiency of which would depend on how the PDF is created, though). Note that I just added an "emulator" mode that will use SDL for rendering/input, so development on a typical linux PC is possible. This allows for rapid prototyping. Don't feel pressed to start on this. It's still a "pet project" for me, I'm doing it just for the joy of doing it. BTW, dpavlin already had a look at it and played with it. Github is a great help for integration work, so if you start playing with it, I suggest to just clone the Github repo. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 60
Karma: 494362
Join Date: Nov 2010
Location: Budapest, Hungary
Device: Kindle 3
|
Hi,
I think a lot of Kindle users would be very very happy for the solution of better PDF handling on Kindle3... So good luck for You! |
![]() |
![]() |
![]() |
#7 | |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 121
Karma: 82565
Join Date: Aug 2010
Location: Maryland, USA
Device: dxg, k3w,k4nt,kpw
|
Quote:
|
|
![]() |
![]() |
![]() |
#8 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
Thanks, that's great! Now I'm even more tempted to make a Qt integration at some point...
|
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
I've just updated the release version (see link in OP for "compiled version"). It now comes in a ZIP file. You are supposed to copy the contents into a folder "test" (sorry, still didn't manage to come up with a clever storage point...) in your document partition. Except for the contents of the "launchpad" subfolder, which you can copy into the launchpad config folder on your document partition if you want to use this integration.
The software now has Gamma adjustment (volume keys), beginnings of flexible Zoom including fit-to-content and now stores last read page and last used gamma for each document viewed. Oh, well, and it comes with a simple file chooser now. I think it's coming towards a point where the main development will focus on the Lua scripts and the C code part is almost stable (although still not complete, things like metadata or text extraction are still missing). I still like the lightweight approach, and it's reasonable fast to script a UI in Lua. I've added access points to font rendering as freetype is included anyway (and some fonts are also always there). It might also be a base for scripters who look for a base that can interface with the framebuffer, the input and also brings sqlite. Lots of little apps come to my mind. So if you like Lua scripting, this might be for you, even if you don't use it to read PDFs. |
![]() |
![]() |
![]() |
#10 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
@hawhill: Do you know of a way to "pause" the framework, so it does not mess with the framebuffer, but can be resumed quickly (not needing a full framework start)?
I tried to kill -STOP the /usr/java/bin/cvm process, which certainly works but seems rather extreme. Even the power switch stops. I can still run launchpad apps though. kill -CONT resumes the cvm process, but when it wakes up it wierds-out, asking if I want to "Delete Collection"... Hmm... There *must* be a better way... P.S. I really do like your PDF viewer. The double-buffered (pre-cached) rendering is great. Keep up the great work. The updates might feel faster if the next-page does a mode 2 (fast) update on button press, followed by a full flash mode 1 update on button release. Mode 21 (negative image) updates could be a useful option. Last edited by geekmaster; 12-08-2011 at 09:59 PM. |
![]() |
![]() |
![]() |
#11 | |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 121
Karma: 82565
Join Date: Aug 2010
Location: Maryland, USA
Device: dxg, k3w,k4nt,kpw
|
Quote:
key presses to be put into CVM's input queue. See capture_input() and release_input() in launchpad/src/main.c This technique is used in Qt keyboard driver for kindle. I even do not send kill -STOP / kill -CONT to CVM, but grab all input devices if I want to run Qt application in a foreground. |
|
![]() |
![]() |
![]() |
#12 |
Member
![]() Posts: 18
Karma: 10
Join Date: Oct 2011
Device: kindle 3.2.1 wifi
|
how do I install this?
|
![]() |
![]() |
![]() |
#13 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
I want to stop the framework from overwriting the top and bottom of the screen (3G signal, battery, etc.). So I think I still need to pause he CVM in that case. That is less severe than a full framework stop and restart like some fullscreen apps do.
|
![]() |
![]() |
![]() |
#14 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,379
Karma: 2155307
Join Date: Nov 2010
Location: Goettingen, Germany
Device: Kindle Paperwhite, Kobo Mini
|
Grab the ZIP from the page, unpack most of its contents to a folder "test" (another one would work, too, but that matches the launchpad scripts) on your Kindle's document partition, except for the contents of the folder "launchpad" which go into the existing launchpad folder (that step would require you installed launchpad beforehand). Reload launchpad config, then you could run it with Shift-P-D (for the file browser mode).
Note that it is still more or less a preview of things to come. I publish it to inspire people to play with it - and that would also mean to change its code. |
![]() |
![]() |
![]() |
#15 |
Carpe diem, c'est la vie.
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,433
Karma: 10773668
Join Date: Nov 2011
Location: Multiverse 6627A
Device: K1 to PW3
|
This looks like a useful feature to add. It could be integrated into your PDF viewer (one page at a time), activated by a menu item or button.
The script that splits the 2-column PDF: http://www.cs.toronto.edu/~hector/1colpdf A sample PDF. Original: http://www.cs.toronto.edu/~hector/jcan.pdf Converted: http://www.cs.toronto.edu/~hector/1col-jcan.pdf Much better than the "zoom box" in the webkit browser, IMHO. |
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
KOReader: a document reader for PDF, DJVU, EPUB, FB2, HTML, ... (GPLv3) | hawhill | Kindle Developer's Corner | 1287 | 03-04-2025 03:52 AM |
Librerator - multi-format e-reader, fork of KPV | Kai771 | Kindle Developer's Corner | 433 | 05-25-2024 03:34 AM |
Yet another PDF viewer (muPDF based) | melihron | PocketBook | 66 | 09-02-2014 03:03 AM |
Text-based PDF to Mobi, etc./Kindle 3 | kidblue | Calibre | 41 | 07-20-2012 03:19 PM |
muPDF on Kindle DX!! | DairyKnight | Kindle Developer's Corner | 8 | 03-21-2010 03:39 AM |