Top Related Projects
The official source code repository for the calibre ebook manager
An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
SumatraPDF reader
PDF Reader in JavaScript
Quick Overview
Zathura is a highly customizable and functional document viewer, primarily designed for PDF files but also supporting other formats. It focuses on providing a minimalistic and keyboard-driven user interface, making it popular among users who prefer efficient navigation and a clutter-free reading experience.
Pros
- Lightweight and fast, with minimal resource usage
- Highly customizable through configuration files
- Vim-like keybindings for efficient navigation
- Supports various document formats (PDF, PostScript, DjVu)
Cons
- Steep learning curve for users unfamiliar with keyboard-centric interfaces
- Limited GUI options compared to more feature-rich document viewers
- May require additional plugins for certain file formats
- Not as user-friendly for those who prefer mouse-based interactions
Getting Started
To install Zathura on a Unix-like system, you can typically use your package manager. For example, on Ubuntu or Debian:
sudo apt-get update
sudo apt-get install zathura
For macOS users with Homebrew:
brew install zathura
After installation, you can launch Zathura from the command line:
zathura document.pdf
To customize Zathura, create a configuration file at ~/.config/zathura/zathurarc
. Here's a basic example:
set recolor true
set recolor-darkcolor "#FFFFFF"
set recolor-lightcolor "#000000"
set statusbar-h-padding 0
set statusbar-v-padding 0
set page-padding 1
map u scroll half-up
map d scroll half-down
map D toggle_page_mode
map r reload
map R rotate
map K zoom in
map J zoom out
map i recolor
map p print
This configuration sets up dark mode, adjusts padding, and defines custom keybindings. Refer to the Zathura manual for more configuration options and usage instructions.
Competitor Comparisons
The official source code repository for the calibre ebook manager
Pros of Calibre
- Comprehensive e-book management with library organization, metadata editing, and format conversion
- Cross-platform support (Windows, macOS, Linux) with a user-friendly GUI
- Extensive plugin ecosystem for customization and additional features
Cons of Calibre
- Larger resource footprint and slower startup time
- More complex interface with a steeper learning curve
- Not optimized for minimalist, distraction-free reading experience
Code Comparison
Zathura (C):
void document_open_idle(void* data)
{
zathura_t* zathura = data;
if (document_info_cache_invalidate(zathura) == false) {
return;
}
document_open_continue(zathura);
}
Calibre (Python):
def open_book(self, path, fmt=None, library_id=None):
db = self.current_db.new_api
if library_id is not None:
db = self.get_library_data(library_id)[0]
mi = db.add_format_with_hooks(path, fmt, run_hooks=False)
return self.book_opened(mi.id, library_id)
Both projects handle opening documents/books, but Calibre's implementation is more complex due to its library management features and support for multiple formats.
An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
Pros of KOReader
- Cross-platform support (Android, Linux, macOS, Windows)
- Rich feature set including dictionary lookup, text-to-speech, and cloud sync
- Highly customizable reading experience with various fonts, themes, and layouts
Cons of KOReader
- Larger codebase and potentially more complex to maintain
- May have a steeper learning curve for new users due to extensive features
Code Comparison
KOReader (Lua):
local ReaderUI = require("apps/reader/readerui")
local ReaderConfig = require("apps/reader/readerconfig")
function ReaderUI:init()
self.config = ReaderConfig:new()
self:setupTouchZones()
end
Zathura (C):
#include "document.h"
#include "zathura.h"
bool
document_open(zathura_t* zathura, const char* path, const char* password,
int page_number)
{
if (zathura == NULL || path == NULL) {
return false;
}
}
KOReader is written primarily in Lua, focusing on e-book functionality and cross-platform support. Zathura, written in C, is a minimalist document viewer primarily for Linux systems. KOReader offers a more feature-rich experience for e-books, while Zathura provides a lightweight, customizable viewer for various document formats.
SumatraPDF reader
Pros of SumatraPDF
- Cross-platform support (Windows, macOS, Linux)
- More feature-rich with annotations, bookmarks, and form filling
- Faster rendering for large PDF files
Cons of SumatraPDF
- Larger file size and resource usage
- Less customizable interface
- Not as well-integrated with Unix-like systems
Code Comparison
SumatraPDF (C++):
void WindowInfo::ShowNotification(const WCHAR* message, bool autoDismiss, bool highlight) {
NotificationWnd* wnd = new NotificationWnd(this->hwndFrame, message, autoDismiss, highlight);
wnd->Create();
}
Zathura (C):
void zathura_document_set_zoom(zathura_document_t* document, double zoom) {
if (document == NULL || zoom <= 0) {
return;
}
document->zoom = zoom;
}
Both projects use low-level languages for performance, but SumatraPDF's C++ code allows for more object-oriented design, while Zathura's C code is more procedural. SumatraPDF's codebase is generally more complex, reflecting its broader feature set, while Zathura's code is more minimalist and focused on core PDF viewing functionality.
PDF Reader in JavaScript
Pros of pdf.js
- Cross-platform compatibility: Runs in web browsers, making it accessible on various devices and operating systems
- Rich feature set: Includes annotations, text selection, and search functionality
- Easily embeddable: Can be integrated into web applications with minimal effort
Cons of pdf.js
- Performance: May be slower than native PDF viewers, especially for large documents
- Dependency on JavaScript: Requires a JavaScript-enabled environment to function
- Limited customization: Less flexible for users who prefer a minimalist interface
Code Comparison
zathura:
void document_open_idle(void* data)
{
zathura_t* zathura = data;
if (document_open(zathura, zathura->document_path, zathura->password,
ZATHURA_PAGE_NUMBER_UNSPECIFIED) == false) {
girara_notify(zathura->ui.session, GIRARA_ERROR,
_("Could not open document '%s'."), zathura->document_path);
}
}
pdf.js:
PDFJS.getDocument(url).then(function(pdf) {
pdf.getPage(1).then(function(page) {
var scale = 1.5;
var viewport = page.getViewport(scale);
var canvas = document.getElementById('the-canvas');
var context = canvas.getContext('2d');
canvas.height = viewport.height;
canvas.width = viewport.width;
page.render({canvasContext: context, viewport: viewport});
});
});
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual CopilotREADME
zathura - a document viewer
zathura is a highly customizable and functional document viewer based on the girara user interface library and several document libraries.
Requirements
The following dependencies are required:
gtk3
(>= 3.24)glib
(>= 2.72)girara
(>= 0.4.3)libmagic
from file(1): for mime-type detectionjson-glib
sqlite3
(>= 3.6.23): sqlite3 database backend
The following dependencies are optional:
libsynctex
from TeXLive (>= 1.19): SyncTeX supportlibseccomp
: sandbox support
For building zathura, the following dependencies are also required:
meson
(>= 0.61)gettext
pkgconf
The following dependencies are optional build-time only dependencies:
librvsg-bin
: PNG iconsSphinx
: manpages and HTML documentationdoxygen
: HTML documentationbreathe
: for HTML documentationsphinx_rtd_theme
: for HTML documentation
Note that Sphinx
is needed to build the manpages. If it is not installed, the
man pages won't be built. For building the HTML documentation, doxygen
,
breathe
and sphinx_rtd_theme
are needed in addition to Sphinx
.
The use of libseccomp
and/or landlock
to create a sandboxed environment is
optional and can be disabled by configure the build system with
-Dseccomp=disabled
and -Dlandlock=disabled
. The sandboxed version of zathura
will be built into a separate binary named zathura-sandbox
. Strict sandbox
mode will reduce the available functionality of zathura and provide a read only
document viewer.
Installation
To build and install zathura using meson's ninja backend:
meson build
cd build
ninja
ninja install
Note that the default backend for meson might vary based on the platform. Please refer to the meson documentation for platform specific dependencies.
Bugs
Please report bugs at https://github.com/pwmt/zathura.
Top Related Projects
The official source code repository for the calibre ebook manager
An ebook reader application supporting PDF, DjVu, EPUB, FB2 and many more formats, running on Cervantes, Kindle, Kobo, PocketBook and Android devices
SumatraPDF reader
PDF Reader in JavaScript
Convert designs to code with AI
Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.
Try Visual Copilot