You are not logged in.
Hello everyone,
I got my hands on some epub files two days ago but I didn't find any reader I liked so I decided to write my own. And here it is:
Screenshot
Git Repository
PKGBUILD
Dependencies:
-python2
-unzip
-gobject-introspection
-python2-gobject
-gtk3
-libwebkit3
Bookmarks are matched with the MD5 hash of each book so they are valid even if you rename or move your books.
In case you have a book that is not working, please extract your epub file like a zip and send me any .opf and .ncx files it has inside. I will do my best to fix the problem then.
So far it's perfectly usable but it could use more features, so please post your ideas here.
Thanks for trying!
Changelog:
21 Nov:
-Now using python's zipfile instead of unzip.
-Updated PKGBUILD for new dependencies.
19 Nov:
-Better error handling.
7 Nov:
-Added icons and a .desktop file.
-Updated PKGBUILD.
6 Nov:
-Added content menu listing all chapters.
-Fixed some minor bugs.
3 Nov:
-Added config validation.
-Added night mode.
-Added User CSS support.
2 Nov:
-Fixed PKGBUILD
-Replaced most menu items with stock ones (for icons)
-Added the ability to enable/disable javascript.
-Fixed menu separators.
1 Nov:
-Switch to GI dynamic bindings and gtk3 support (by Laurent Bigonville)
-Now it cleans the cache on exit.
-Added limit to zoom level.
-The default cache path includes user's name (so multiple users can use it on the same time)
-Changed permissions for cache (700)
-Updated PKGBUILD (new dependencies)
31 Oct:
-Fixed license (by Psycojoker)
-Fixed a bug that prevented ppub from running when using an older version of webkit (by Psycojoker)
29 Oct:
-Added zoom controls
-Added caret mode
-Changed keyboard shortcuts for chapter navigation:
--Next chapter: Right instead of Control+Right
--Previous chapter: Left instead of Control+Left
-Minor bugfix (with .css)
-Disabled more useless webkit features
28 Oct:
-Fixed PKGBUILD
-Added support for non-standard .opf paths
-Fixed opening files containing 'bad' characters in their filenames.
-Disabled some browser-related features webkit was loading.
Known bugs:
-Cover pages don't work.
-Links inside book pages work but they mess up the current chapter value. The chapter changes but the application is unaware of it, so it changes back later.
Last edited by sakisds (2011-11-21 14:01:10)
Offline
When I try to run ppub I get the following error:
File "/usr/bin/ppub", line 56
return u'{%s}' % ', '.join([u'%s:%s' % (k,repr(v)) for k,v in items])
^
SyntaxError: invalid syntax
Offline
Same problem as lowph.
I was going to ask whether it supported embedded fonts.
Offline
Sorry about that, I forgot that python 2.7 is in the python2 package, I updated the PKGBUILD, should work now.
@frabjous: I am sure fonts work if they are installed system-wide but I don't have a book that has embedded fonts to try (not exactly sure how epub packs them). Please try and if they don't work, I will see what I can do.
Offline
It doesn't seem to work at all, at least with the ones I tried. Now, a screen comes up, but it's blank and none of the navigation commands seem to do anything.
Here's an epub I created that has embedded fonts. (The work is public domain.) I made this by hand by hand-writing the XHTML and XML files and hand-zipping them up (in the appropriate way for the epub spec.) It passes epubcheck, so should work:
tlp.epub
Here's another one I made, but not by hand, but instead by converting through calibre (another public domain title). This one doesn't have embedded fonts, and doesn't pass epubcheck. (I don't think calibre's ever do, though... still, you'll want to support them.)
imp.epub
When I try to open that one, it says "Error opening file: No such file or directory" in the ppub window.
(I'm actually mostly interested in your viewer to make sure that epubs I make are compatible with it.)
I also tried it with the NET bible epub, with no luck. (No, before you ask, I'm not religious... I just figured that was probably a fairly standard book people will want it to work with.) It has embedded fonts, and passes epubcheck.
Last edited by frabjous (2011-10-28 14:04:26)
Offline
With the new PKGBUILD it works.
I was looking for a nice and simple epub viewer, thanks.
When the path or filename contains a round bracket ( it will crash giving:
sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `unzip -d /tmp/ppub-cache/ '/home/username/ebookfilename (epub).epub''
It's a bit it annoying to switch between chapters using the menu or ctrl+right. I would prefer it to automatically go to the next chapter when reaching the end of a chapter.
Offline
I tried these files, both tlp.epub and the bible work fine but without the embedded fonts. After a bit of searching it seems that .css files can declare fonts that browsers use even if they are not installed on the machine. Theoretically, if I 'fix' the book's .css file to contain these declarations at extraction time the custom fonts should render without problems. I am trying to code this in meantime.
Also, after some changed the file made with calibre opens file (and more files should work too) but the chapters are in a wrong order. It seems the files are listed randomly in the .opf file. This will be fixed after I add support for table of contents (the .ncx file), but fonts take priority.
On a side note, it seems the links inside the book at the bible file mess up the current chapter value. They work, but when you try to change the chapter using the application you are back to where you were.
Offline
With the new PKGBUILD it works.
I was looking for a nice and simple epub viewer, thanks.When the path or filename contains a round bracket ( it will crash giving:
sh: -c: line 0: syntax error near unexpected token `(' sh: -c: line 0: `unzip -d /tmp/ppub-cache/ '/home/username/ebookfilename (epub).epub''
It's a bit it annoying to switch between chapters using the menu or ctrl+right. I would prefer it to automatically go to the next chapter when reaching the end of a chapter.
Hm, thanks for noting, I will add code to sanitize the filenames. Also I will add more keyboard shortcuts.
Edit: Fixed, files with brackets (or other 'bad' characters) should work now.
Last edited by sakisds (2011-10-28 15:35:28)
Offline
That was fast.
Edit: Works like a charm.
Last edited by lowph (2011-10-28 15:34:03)
Offline
I still can't get either the net bible or tlp.epub to work at all. Same symptom as before: ppub opens but with a blank window.
imp.epub works, but as you say, with the chapters in the wrong order.
The output on the command line reads, after the stuff about extracting the files:
ERROR: Invalid browser function table. Some functionality may be restricted.
Picked up _JAVA_OPTIONS: -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel
java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.4) (ArchLinux-6.b22_1.10.4-1-x86_64)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)
Offline
That's strange, Java shouldn't be there. I think webkit was trying to load browser plugins for some reason. Anyway I pushed a new version with plugins and javascript disabled (and some other browser-related features), both for security and because they are useless in epubs. Can you try and see if it works now?
Offline
No luck. Nothing on the command line now except the stuff about inflating the zipped files.
Offline
@frabjous: After some changes and testing, I managed to get the same output with Calibre on tlp.epub. On the same file lucidor defaulted to the system font. With the Bible all 3 viewers used the system font and with imp.epub all viewers used the embedded font. So I mark embedded fonts as supported.
The reason that these books doesn't load on your system is surely something else, I am trying to find the cause.
Offline
Nice app, KISS as we like. It worked fine for me.
There are few more comments on Hacker News, that might give you some ideas.
Thanks for pPub.
Offline
Thanks, I will look into these suggestions when I got some time (temporary away from home).
Offline
I think the new version is missing some dependencies, until I installed python2-gobject ppub was refusing to launch and throwing errors about how there was no module called gi.repository
Offline
Thanks for noting, fixed.
Offline