Coder Social home page Coder Social logo

koreader / kindlepdfviewer Goto Github PK

View Code? Open in Web Editor NEW
498.0 498.0 98.0 7.99 MB

(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

License: GNU General Public License v3.0

Lua 99.78% Shell 0.22%

kindlepdfviewer's Introduction

KOReader

KOReader is a document viewer primarily aimed at e-ink readers.

AGPL Licence Latest release Gitter Mobileread Build Status Coverage Status Weblate Status

DownloadUser guideWikiDeveloper docs

Main features

  • portable: runs on embedded devices (Cervantes, Kindle, Kobo, PocketBook, reMarkable), Android and Linux computers. Developers can run a KOReader emulator in Linux and MacOS.

  • multi-format documents: supports fixed page formats (PDF, DjVu, CBT, CBZ) and reflowable e-book formats (EPUB, FB2, Mobi, DOC, RTF, HTML, CHM, TXT). Scanned PDF/DjVu documents can also be reflowed with the built-in K2pdfopt library. ZIP files are also supported for some formats.

  • full-featured reading: multi-lingual user interface with a highly customizable reader view and many typesetting options. You can set arbitrary page margins, override line spacing and choose external fonts and styles. It has multi-lingual hyphenation dictionaries bundled into the application.

  • integrated with calibre (search metadata, receive ebooks wirelessly, browse library via OPDS), Wallabag, Wikipedia, Google Translate and other content providers.

  • optimized for e-ink devices: custom UI without animation, with paginated menus, adjustable text contrast, and easy zoom to fit content or page in paged media.

  • extensible: via plugins

  • fast: on some older devices, it has been measured to have less than half the page-turn delay as the built in reading software.

  • and much more: look up words with StarDict dictionaries / Wikipedia, add your own online OPDS catalogs and RSS feeds, over-the-air software updates, an FTP client, an SSH server, …

Please check the user guide and the wiki to discover more features and to help us document them.

Screenshots

Installation

Please follow the model specific steps for your device:

AndroidCervantesKindleKoboLinuxPocketbookreMarkable

Development

Setting up a build environmentCollaborating with GitBuilding targetsPortingDeveloper docs

Support

KOReader is developed and supported by volunteers all around the world. There are many ways you can help:

Right now we only support liberapay donations.

Contributors

Last commit Commit activity

kindlepdfviewer's People

Contributors

chrox avatar dpavlin avatar germanc avatar houqp avatar hwhw avatar kai771 avatar niluje avatar tchaikov avatar tigran123 avatar zenroi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kindlepdfviewer's Issues

any plan for new release?

We have added lots of new stuffs in the reader and the change log in wiki now has one page long. :) It's amazing.

Among all the changes, I think the new settings module should be delivered to end users as soon as possible, otherwise, with older version, they will have many sqlite DBs generated in their book folders, which will not be used by the new version from now.

I suggestion once we stopped adding features, we should do some testing and pack a release. I am in curious, how many new features are under development currently?

sharing point for problematic media

as referenced on comments for commit c8f87d5, it may be useful if we have a common point where we may shere "problematic meda", i.e. documents that causes issues on kpdfview. For instance they don't open at all; causes crash of application; don't render correctly; have problems with toc; and so on.

Since i didn't find any better place (and i'm a bit lazy to deal with new account creation on similar services..), i just used a public folder of my dropbox account. This is the short link:
http://db.tt/qevNIYvi

Now you can just download form there, but if you also have a dropbox account, or plan to make one, i may just share the folder with you, providing a read/write access.

For now there are just two documents.

The file <doc_name>.notes.txt includes detailed informations about the issue.

UPDATE: the public link has been modified and now points to a folder containing only public documents (as requested by @houqp, for copyright reasons I think).
To access private documents you need to login into dropbox. Let me know your dropbox username and I will invite to the private folder.

djvu support is broken in 3.2.1 firmware

ELiNK reports that djvu files cannot be opened in 3.2.1 firmware. When selected a book, kpdfview exits and launchpad displays "Success!".

Do any of you has a 3.2.1 firmware for testing?

Add support for local links in PDF files

I think it will be useful to add support for local links in PDF files. I don't mean a links which point to another pdf files or Internet URLs. I mean links which points to other pages of the original document. It is handy thing when reading books which contain endnotes.

memory handing and problems

there are too many memory knobs as described by our problem to communicate correct settings on mobileread forum http://www.mobileread.com/forums/showpost.php?p=2023375&postcount=194

Right now, we in unireader.lua we have:

    -- tile cache configuration:
    cache_max_memsize = 1024*1024*5, -- 5MB tile cache
    cache_item_max_pixels = 1024*1024*2, -- max. size of rendered tiles

but we also have in pdfreader.lua:

function PDFReader:open(filename)
    -- muPDF manages its own cache, set second parameter
    -- to the maximum size you want it to grow
    local ok
    ok, self.doc = pcall(pdf.openDocument, filename, 64*1024*1024)

It seems to me that we need to do grep MemFree /proc/meminfo as sane default value (in lua, somehow :-) and then assign that in some ratio to cache_max_memsize, cache_item_max_pixels and mupdf if we are viewing pdf file (otherwise, it would be nice to have more memory for first two variables).

Any takers?

write access to repository needed to close issues in commit messages

I experimented with closing issues using commit messages, and according to https://github.com/features/projects/issues I need write access to repository. This way I create two issues, one for bug itself and another for pull request and that just clutter issue tracker.

https://github.com/features/projects/issues

Close and Reference with Commit Messages

Issues know all about commits. By using a few simple keywords you can close an issue right from a commit message, or just leave a note on the issue.

The syntax is basic: if you want to close issue #35, put closes #35 somewhere in your commit message then push to GitHub.

Supported keywords: close, closes, closed, fixes, fixed

Leaving a note on an issues referencing your commit is even easier — just mention the issue number without using one of the above keywords, e.g. This commit references #35.

Anyone with write access to your repository may close an issue or leave a note.

compilation issue

when making the project (in EMULATE_READER mode), i have to lauch make three time, since it goes in error the first two times. I don't know if it's an issue of my specific environment, or something wrong with makefile.

user@compilebox:~/kindle/git/kindlepdfviewer-traycold$ make clean
rm -f *.o kpdfview
user@compilebox:~/kindle/git/kindlepdfviewer-traycold$ make
gcc -c -O3 -Ilua/src -Imupdf/ -Iluafilesystem/src kpdfview.c -o kpdfview.o
gcc -c -O3 -Ilua/src -Imupdf/ -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DEMULATE_READER -DEMULATE_READER_W=412 -DEMULATE_READER_H=600 \   einkfb.c -o einkfb.o
gcc:    : No such file or directory
make: *** [einkfb.o] Error 1
user@compilebox:~/kindle/git/kindlepdfviewer-traycold$ make
gcc -c -O3 -Ilua/src -Imupdf/ -Iluafilesystem/src pdf.c -o pdf.o
pdf.c: In function ‘openDocument’:
pdf.c:65: warning: passing argument 2 of ‘pdf_authenticate_password’ discards qualifiers from pointer target type
mupdf/pdf/mupdf.h:370: note: expected ‘char *’ but argument is of type ‘const char *’
gcc -c -O3 -Ilua/src -Imupdf/ -Iluafilesystem/src blitbuffer.c -o blitbuffer.o
gcc -c -O3 -Ilua/src -Imupdf/ -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DEMULATE_READER -DEMULATE_READER_W=412 -DEMULATE_READER_H=600 \   input.c -o input.o
gcc:    : No such file or directory
make: *** [input.o] Error 1
user@compilebox:~/kindle/git/kindlepdfviewer-traycold$ make
gcc -c -O3 -Ilua/src -Imupdf/ -Iluafilesystem/src util.c -o util.o
gcc -c -O3 -Ilua/src -Imupdf/ -Imupdf/thirdparty/freetype-2.4.8/include ft.c -o ft.o
ft.c: In function ‘newBuiltinFace’:
ft.c:73: warning: passing argument 1 of ‘pdf_find_builtin_font’ discards qualifiers from pointer target type
mupdf/pdf/mupdf.h:622: note: expected ‘char *’ but argument is of type ‘const char *’
gcc -c -O3 -Ilua/src -Iluafilesystem/src luafilesystem/src/lfs.c -o lfs.o
gcc -c -O3 -Ilua/src -Imupdf/ -Idjvulibre/ djvu.c -o djvu.o
gcc -lm -ldl -lpthread -L/usr/lib -lSDL -lstdc++ \
        kpdfview.o \
        einkfb.o \
        pdf.o \
        blitbuffer.o \
        input.o \
        util.o \
        ft.o \
        lfs.o \
        mupdf/build/debug/libfitz.a \
        mupdf/build/debug/libfreetype.a mupdf/build/debug/libjpeg.a mupdf/build/debug/libopenjpeg.a mupdf/build/debug/libjbig2dec.a mupdf/build/debug/libz.a \
        lua/src/liblua.a \
        djvu.o \
        djvulibre/build/libdjvu/.libs/libdjvulibre.a \
        -o kpdfview
lua/src/liblua.a(loslib.o): In function `os_tmpname':
loslib.c:(.text+0x46): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
user@compilebox:~/kindle/git/kindlepdfviewer-traycold$ 

Bug with screensaver

Hi,

I found interesting bug accosiated with showing screensaver:

  1. Rotate image on 90 degrees;
  2. Move slider to go to the sleep mode.

After doing this I see something like this:
After doing this I see something like this.

And after moving slider again:
And after moving slider again.

Original screensaver:
Original screensaver.

the current set zoom feature works not so well for file with large page size

I found this when testing the djvu file in my computer. The original per-page size is very large, thus after setzoom, its zoom factor turned out to be 0.148515.

Now if I zoom that page with altmode set, the zoom factor is added by 0.1, which makes the page about 70% larger. This step is too large that it somehow make the zoom feature unusable for this kind of files.

Any ideas for deterministic zooming implementation that handles large page size?

Wrong TOC title encoding in some DjVu files

eLiNK reports that one of his djvu book's TOC is not displayed correctly. I uploaded the test file to our DropBox share point and renamed to toc_title_encoding.djvu.

Some TOC titles in this book contains German umlauts like ä which is not displayed in our reader. After some debugging, I noticed that those German umlauts are not represented in UTF8. For instance, ä is represented as 0xE4 not 0xC3,0xA4. To double check, I opened this book with Okular (which also uses libdjvulibre) and it behaviors the same.

However, I tried other books with German umlauts TOC and those umlauts are encoded correctly. So I suspect the book is corrupted.

But eLiNK says when he open this book in WinDjView, those umlauts are handled correctly. WinDjView is also a freesoftware based on libdjvulibre, but I don't have time to look into yet.

page:getUsedBBox() sometimes return invalid values

On some pages, getUsedBBox return 0.01,0.01 -0.01,-0.01which breaks fit to content and two column zoom factor by increasing it to 60.

Example file: http://bsdmag.org/system/articles/attachment1s/14274/original/FreeBSD_Portability_With_VMware_BSD_04_2011.pdf

This file contains huge bitmap backgrounds and works really bad with this pdf viewer, partly because of our memory limits. But bounding box problem happens even before we hit first memory limit.

font handling changed

I just commited a larger patch that introduces a new approach to fonts. I hope I got everything in order. Unfortunately, some local Makefile changes of mine (toolchain settings) got in the mix, so I fixed that on the go and made it more flexible. I hope I haven't broken too much stuff - please tell me if I did...

Speed optimizations

I've just switched the default CFLAGS in the Makefile to stop outputting debug symbol information (not performance relevant, but doesn't make much sense when optimizing) - and more importantly switched over to "-O3". The former "-O0" lead to the horrible performance regarding bitmap scaling since a fz_mul255 wasn't properly inlined then - which made for lots and lots of function calls. "-O2" is already much better, "-O3" does give another small performance benefit.

Also, I've specified "-march=armv6", gives a small speed-up.

There's room for more optimization in the muPDF code, I think. We could edge out a few cases that are more directed towards colored output, we could use the fact that we're going grayscale there.

This also works great for the PDF linked in issue #25

return to file chooser from opened document

It seems that Alt+Back now exists reader, just like Home does. I would love to have ability to return to file chooser without restarting reader.

Maybe shift+Home could bring file chooser instead of exiting?

implement manual page crop

Some pdf files have bounding boxes totally wrong. djvu doesn't have it at all. Before I started using this reader, I was cropping pdfs manually to provide better experience, but now I can code that in lua :-)

Idea is to provide manual margins (with option to specify different ones for odd and even pages) and use that instead of page:getUsedBBox values. This would make two-column mode and all fit-to-content zoom levels work automatically.

To implement it, I would need a way to draw lines over rendered pdf page. Something like xor 0xff might be perfect, since I could just re-draw line if I move it. I did a quick look in blitbuffer.c, and it seems to me that I need paintRect which will do XOR with value, so I will give my rusty C knowledge a spin.

Release 2012.04?

Hi,

what do you think, should we release 2012.04 soon?

I'd like to add in a key config for launchpad to restart the framework. But that's it for now. Everything else has time until after release, I think. What do you think?

caching of rendered tiles out of shape

The mechanism which is used to save rendered tiles should probably get adapted to the current state of things regarding zooming/panning (and later also: rotating). When zoomed, I'd like to render full pages (up to a certain size, at least). Then display only excerpts of those rendered tiles. I think currently, we're re-rendering each time we pan on zoomed pages. Also, pre-caching the next page doesn't work right now.

serializing lua state of current document (zoom, pan, etc)

Serializing state of document would be useful for last read page tracking, but also for different zoom levels or pans for odd/even pages in pdfs which have different layout.

I'm lua newbie and it seems there are a lot of ways to dump serialize lua data, do you have any ideas about that?

Non-ascii characters in djvu file name crashes kpdfviewer

eLiNK has found the causes the crash in issue #39. Please see his message below:

I believe I found the source of the problem.
All of the files I tried to open contained some of the german specific letters (like ä,ö,ü, and ß).
As soon as I renamed one of the files (e.g. Strauß.djvu -> Strauss.djvu), I can open djvu files as well.

If I run kindlepdfviewer from ssh, everything goes fine. But when I run it with launchpad, it crashes when trying to open a djvu file from file browser.

I guess this bug might affect file name with characters from other languages as well. Just checked with Chinese file name and it crashes too.

Pdfs are not affected though.

need help from integrating crengine library

I am not familiar with cmake and get stuck in the build system :(

Since we are now using freetype, I think it's better to keep using it as the font engine in CREngine. By default, CREngine enables Fontconfig. To disable it, we need to set the USE_FONTCONFIG macro to 0. But CREngine uses a global crsetup.h header to define macros and since this file is part of upstream, I cannot change its content.

CREngine uses cmake build system, and it seems that arguments from command line like CFLAGS and CC are not recognized by the auto generated makefile.

One possible solution might be adding an outer CMakeLists.txt in kindlepdfviewer's root directory and invoke CREngine's cmake system with custom changes of CFLAGS CC etc. But introducing cmake to kindlepdfviewer is obviously over kill.

Or we can add command in current makefile to temporally modify crsetup.h before building. However, this seems too dirty and it still cannot specify variables like CC.

I have run out of ideas. Any guidance?

PS: in case you want to look at the source, a half-done demo for crengine can be found at my branch.

cache size control for DJVU

Hi,

I just found that djvulibre also provides API for cache size control(starts from ddjvuapi.h line 220). Hope somebody can take a look and add a knob in our code.

Still select time out in waitForEvent

Following is my crash.log for going into screen saver after a period of time:

lua config error: ./unireader.lua:931: Waiting for input failed: 4

It is strange that the NULL argument is not blocking the select system call forever. Also I don't understand why there is no select time out when running kpv in ssh (even with previous version that does not pass NULL to select).

PDF highlighting: engine now in unireader

I've just checked in PDF highlighting. Bad thing however is that it is still buggy. And I really hope I did not break djvu highlighting. A quick check showed it was still working. But please test extensively.

I still have to fully grasp the highlighting code. I found some rough edges that were DJVU specific and tried to flesh them out. But PDF highlighting still does not work correctly regarding zoom and some other things.

Auto-rotation on KDX

There are bug reports about auto-rotation on the KDX (the K3 doesn't have such a feature). I'm not sure if we can do anything about it. We could e.g. poll rotation state? Maybe there's also a lipc-event upon auto-rotation?

Power slide event capturing

I have been playing with this for a whole afternoon and with little progress. :(

Well, some how I did find a ugly way to capture the event:

use lipc-wait-event -s 0 com.lab126.powerd goingToScreenSaver,outOfScreenSaver to capture the event. Then parse the return value and simulate a event to our inputloop.

This does work for the purpose of event capturing, but it can not hold a exclusive access to the event like EVIOCGRAB request to ioctl. So the framework will also receive the event and mess things up. If this can be fixed, we can fix bug #85.

Why is the power slide so different from other keys? Which part of the kernel source should I read to find out the reason?

linux/einkfb.h - missing or unimplemented?

Should I start writing one? :-)

debian-armel:~/kindlepdfviewer# make
gcc -O2 -Ilua/src -Imupdf/ -DEMULATE_EINKFB_FILE='"/tmp/displayfifo"' -DEMULATE_EINKFB_W=824 -DEMULATE_EINKFB_H=1200 -c -o kpdfview.o kpdfview.c
In file included from kpdfview.c:28:
einkfb.h:28:26: error: linux/einkfb.h: No such file or directory
make: *** [kpdfview.o] Error 1

Bug in panning with alt key

Seems that alt key is very different from shift key. When you press alt key alone, it will not generate alt key press event. And when you press alt key with following keys, it will not generate alt key events too:

  • Q-P (only numbers, not combinations of alt+char)
  • fiveway keys (only fiveway key events, no alt key event)

This leads to a bug in panning. When we use alt + fiveway to pan, it should move in 20 pixels. It actually does in EMU mode, but in real kindle, it still moves 100 pixels.

Page rotation wrong

vmonkey reported a bug on mobileread forums with rotated PDF pages:
http://www.mobileread.com/forums/showpost.php?p=2009485&postcount=166

This probably affected all PDFs where pages specified an individual rotation setting. Result was a "blank" page because the page got rotated out of view. You could "rotate it in" with J/K, but this does not properly (re-)calculate bounding box and isn't really a fix either. The culprit is the changed rotation handling of muPDF, which now does the rotation handling automatically (thus it was rotated twice).

Fix coming in a few seconds, issue only for completeness.

Shoule we add a new zoom mode or change current fit to content mode?

Currently, fit to content width/height mode is not so useful for my k3. Every time I press the shortcut, it is zoomed, but offset is set to the middle of the page. But what I want is to read from the beginning. And I cannot use other keys to navigate inside the page. I am kind of trapped in the middle.

I think a more useful mode will be something like this:

zoom to fit content width, set offset to the beginning. And when you press PGFWD, it jump to next part of current page. If reached page bottom, then do a real page turn. Just like the native reader does.

Place for storing highlights?

Just notice that Amazon store the PDF's annotation and highlights in a seperate PDR file. Should we follow this approach? Currently, for djvu, we store highlight in book's setting files which may grow large and unmanageable for users if there are too many highlights.

Coding Styles

The cleanup work should leave to next release I think.

I went through the Lua wiki and following guidances relavent to our project:

  • Booleans

It can be helpful to prefix Boolean values or functions used as predicates with is, such as is_directory rather than directory

  • Function naming
    camelCap
  • Variable naming
    • All variables should use underscores: offset_x
    • global variables should be prefixed with G_: G_width
  • Constants
    ALL_CAPS
  • Module/package naming
    Module names are often nouns with names that are short and lowercase, with nothing between words. (we are doing fine with this)
  • i, k, v, and t are often used as follows:
for k,v in pairs(t) ... end
for i,v in ipairs(t) ... end
mt.__newindex = function(t, k, v) ... end
  • Class names

Class names (or at least metatables representing classes) may be mixed case (BankAccount), or they might not be. If so, acronyms (e.g. XML) might only uppercase the first letter (XmlDocument).

Using of TOC breaks this ;P

Some other tips I found might be useful:

  • Use locals rather than globals whenever possible.
  • End terminator

Because "end" is a terminator for many different constructs, it can help the reader (especially in a large block) if a comment is used to clarify which construct is being terminated:

for i,v in ipairs(t) do
    if type(v) == "string" then
        ...lots of code here...
    end -- if string
end -- for each t
  • Check empty table
    Determine if a table t is empty (including non-integer keys, which #t ignores):
    if next(t) == nil then ...

Reference: http://lua-users.org/wiki/LuaStyleGuide

move third-party git checkouts into submodules

Was: Should we include a git pull when compiling third party libs?

Since mupdf, djvulibre and luafilesystem are cloned from their git repositories with target fetchthirdparty, I think adding a git pull statement within target makethirdparty could help having more consistent builds (at least, not dependend on when last executed target fetchthirdparty)

Widget framework

Hi,

to allow for easily creating Dialogs and Menus, I have started a Widget framework.
It's this commit: b6d75b8

The commit message contains example code.

I think I like to migrate other dialogs over to use a Widget based interface when release is done.

I plan to add an implementation for message boxes and similar stuff.

The nice thing about it is that it can do alignment and size calculations.

Also, I added image handling. I reused mupdf code for that. It's commit 38afb59
It is already integrated into the Widget framework so that there are now Text and Image widgets.

failed to build ft.o because of lacking required head file.

When building, it complains: ft.c:21:22: error: ft2build.h: No such file or directory

The thridparty has been updated, so

FREETYPEDIR=$(MUPDFDIR)/thirdparty/freetype-2.4.4

should be changed to:

FREETYPEDIR=$(MUPDFDIR)/thirdparty/freetype-2.4.8

configurable line-spacing in crengine

I did a quick grep over crengine source code, and it seems that they are modifing CSS values to get configurable line space (I'm basing this assumption on code from crengine/crengine/src/lvtinydom.cpp.

We should probably have to do something similar, since Linux Journal epubs seem to have too little line spacing to be comfortable read...

I don't have a clear idea where to start, but hopefully @houqp does :-)

Self-documenting keyboard shortcuts

Motivation:

  • inline documentation for keyboard shortcuts within code itself (for easy maintenance, instead of wiki which we would need to render to pdf to somehow provide as help file in reader)
  • provide menu from which users can review shortcuts or select them if they are on device without keyboard (I had Kindle 4 without keyboard in my handles, and it took me a while to figure out that even if I knew how to start our reader on it, it would still be useless)

I propose to write function called within if/else/end code in unireader.lua file this:

key_help("Alt+F","zoom without margin",ev)

This function would populate key_help_overview lua table in sequence in which functions are called. That table would be saved on reader exit, providing quick review help file.

This approach has several advantages: while you are developing you will press all new keyboard shortcuts, thus creating correct help file and ability to edit it allows easy creation of "simplified" readers.

Also, since help is added in sequence in which keys are pressed (during development) this allows logical ordering instead of alphabetical one if we depended on key sort order.

Another possibility is for key_help to also display feedback to user.

Last parameter ev is needed to record correct keypress which generated help message, so we can implement fake events correctly.

Memory usage control needed

eLiNK reports that the kpdfview causes his kindle DXG reboot (framework restart) after some page turns. The reboot can always be reproduced by serval page turn in files with large images. I saw his top command output and found that his kindle is ran out of memory:

top - 02:42:38 up 42 min,  1 user,  load average: 2.02, 0.97, 0.45
Tasks:  56 total,   3 running,  51 sleeping,   1 stopped,   1 zombie
Cpu(s): 90.1%us,  6.6%sy,  0.0%ni,  0.0%id,  3.0%wa,  0.3%hi,  0.0%si,  0.0%st
Mem:    127172k total,   125136k used,     2036k free,     2608k buffers
Swap:        0k total,        0k used,        0k free,    13332k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 4398 root      25   0 79592  62m 1920 R 82.8 50.0   0:33.96 reader.lua
 4469 root      24   0  248m  30m 6120 R 11.9 24.6   0:05.66 cvm
 4391 root      15   0  2384  672  436 R  0.7  0.5   0:01.80 top
  146 root      10  -5     0    0    0 D  0.3  0.0   0:04.53 mmcqd
 2155 root      15   0 19684  728  520 S  0.3  0.6   0:00.59 powerd
    1 root      15   0  1484  104   40 S  0.0  0.1   0:01.13 init.sysvinit
    2 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kthreadd
    3 root      34  19     0    0    0 S  0.0  0.0   0:00.00 ksoftirqd/0
    4 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 watchdog/0
    5 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 events/0
    6 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 khelper
   37 root      10  -5     0    0    0 S  0.0  0.0   0:00.03 kblockd/0
   38 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 cqueue/0
   40 root      10  -5     0    0    0 S  0.0  0.0   0:00.29 mxc_spi.1
   58 root      12  -5     0    0    0 S  0.0  0.0   0:00.03 kmmcd
   76 root      15   0     0    0    0 S  0.0  0.0   0:00.00 pdflush
   77 root      15   0     0    0    0 S  0.0  0.0   0:00.00 pdflush
   78 root      10  -5     0    0    0 D  0.0  0.0   0:00.89 kswapd0
   79 root      20  -5     0    0    0 S  0.0  0.0   0:00.00 aio/0
   99 root      20  -5     0    0    0 S  0.0  0.0   0:01.85 mtdblockd
  134 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 kondemand/0
  157 root      12  -5     0    0    0 S  0.0  0.0   0:00.00 kjournald
  259 root      11  -4  1520  400  236 S  0.0  0.3   0:00.91 udevd
  497 root      10  -5     0    0    0 S  0.0  0.0   0:00.03 kjournald
  728 root      10  -5     0    0    0 S  0.0  0.0   0:00.30 eink_fb_bt
  730 root      10  -5     0    0    0 S  0.0  0.0   0:00.00 eink_fb_pt
  806 root      15   0  1948  524  304 S  0.0  0.4   0:00.79 syslog-ng
  933 root      10  -5     0    0    0 S  0.0  0.0   0:01.46 charger/0
 1261 root       0 -20     0    0    0 S  0.0  0.0   0:02.19 loop0
 1296 root      25   0 56152 1112  184 S  0.0  0.9   0:11.05 fsp
 1349 root      15   0  2128  124   16 S  0.0  0.1   0:00.19 launchpad
 1418 root      25   0  2656  164    4 S  0.0  0.1   0:00.03 lifeguard
 1480 root      25   0  2656  164    4 S  0.0  0.1   0:00.00 lifeguard
 2012 messageb  16   0  2236  564  340 S  0.0  0.4   0:00.46 dbus-daemon
 2105 root      15   0 19608  744  512 S  0.0  0.6   0:00.46 pmond
 2319 root      18   0 44504  536  292 S  0.0  0.4   0:00.10 wand
 2410 root      18   0 47720  616  260 S  0.0  0.5   0:00.14 phd
 2473 root      17   0 35784  184    0 S  0.0  0.1   0:00.02 mcsd
 2529 root      15   0 19600  196    0 S  0.0  0.2   0:00.08 volumd
 2732 root      18   0 50040 1176  472 S  0.0  0.9   0:00.42 audioServer
 2786 root       1 -19 1018m 2800   48 S  0.0  2.2   0:00.39 ttsd
 2948 root      17   0 38936  688  268 S  0.0  0.5   0:00.10 tmd
 2966 root      16   0  2652   96    4 S  0.0  0.1   0:00.05 crond
 2972 root      25   0 19324  544  388 S  0.0  0.4   0:00.03 lipc-daemon
 3059 root      18   0 85576 2664    0 T  0.0  2.1   0:00.73 browserd
 3133 root      18   0  2656  572  392 S  0.0  0.4   0:00.55 start.sh
 3213 root      17   0     0    0    0 Z  0.0  0.0   0:00.00 sh <defunct>
 3303 root      18   0  2656   84    0 S  0.0  0.1   0:00.00 getty
 3670 root      20   0 36032  236    0 S  0.0  0.2   0:00.07 cmd
 4364 root      15   0  1816  112   32 S  0.0  0.1   0:00.10 busybox
 4378 root      16   0  2084   96    4 S  0.0  0.1   0:00.01 dropbear
 4388 root      15   0  2656   96    4 S  0.0  0.1   0:00.01 sh
 4396 root      17   0  2652   76    0 S  0.0  0.1   0:00.00 sh
 4397 root      19   0  2656   84    4 S  0.0  0.1   0:00.01 kpdf.sh
 4462 root      18   0  2656  572  372 S  0.0  0.4   0:00.00 start.sh

This is the snapshot after the reboot, so I guess reader.lua consumed more memnory before the reboot. I suspect the reboot is caused by the framework, which forces a brute force gargage collection when memory is low. It does not happen to me maybe because my K3 has double memroy.

I don't have a DXG to test with. Does this also occur to your DXG?

Shortuct for refreshing page

Hi,

It would be great to have shortcut for refreshing page (like in CoolReader). I've seen such method in API.
Or is it possible for program to refresh page after each leaf (like in default pdf reader in kindle)?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.