High-Performance
Terminal & CLI PDF
Swiss Army Knife
A lightning-fast, keyboard-driven dual-pane TUI viewer and POSIX-compliant CLI processor for Linux. Merge, split, extract, rotate, OCR, and inspect PDFs in under 10 milliseconds.
โ THE RUST PROGRAMMING LANGUAGE โ
โ Chapter 4: Understanding Ownership โ
โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โ โข Each value in Rust has an owner โ
โ โข There can only be one owner โ
โ โข When owner goes out of scope, โ
โ the value will be dropped. โ
โ โ
โ [LRU Cache Hit: 4.2 MB / 128 MB] โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
// Page 3 Content extracted via lopdf text stream:
01| Ownership is Rust's most unique feature and has deep implications.
02| It enables Rust to make memory safety guarantees without
03| needing a garbage collector. Understanding ownership requires
04| taking time to grasp the stack and heap allocation models.
05| In systems programming, memory leaks and double-free bugs are fatal.
06| Bit PDF Reader applies these exact principles to handle huge docs.
07| [Match 1 of 3 found on page 3] <Press 'n' for next>
Architected on premier Rust systems libraries & open-source standards
Everything You Need to Command PDFs
No browser bloat. No electron containers. A standalone native tool crafted with zero compromises in memory safety, throughput, and ergonomics.
Dual-Mode Architecture
Interactive terminal reader with dual panes when you need to visually read and search documents; scriptable POSIX CLI when automating batch operations.
$ bit-pdf merge *.pdf -o all.pdf
Pure-Rust lopdf Engine
Direct object graph navigation, compression, rotation, deletion, and cross-reference table rebuilds with zero external C++ runtime dependencies.
โข Memory-safe parser
TrueColor Half-Block
High-fidelity vector-to-bitmap rasterization using 24-bit TrueColor upper/lower half-block (โ) ANSI characters. Visual rendering right in your console.
โข Works in Kitty, Alacritty, Foot
Async Tesseract OCR
Background workers convert scanned images into searchable sandwich PDFs or raw text streams. Features binarization filters and cancellation tokens.
โข Lock-free crossbeam channels
Atomic File Safety
All writes stage to unique hidden temporary files before atomic filesystem rename. Guaranteed zero corrupted PDFs even if interrupted by SIGINT or power loss.
โข Zero half-written outputs
SQLite WAL Persistence
Embedded transactional SQLite storage saves your bookmarks, reading positions, search histories, and recent files under ~/.local/share/pdfx/.
โข Instant bookmark restore
Interactive CLI Command Builder
Configure operations visually and preview the exact shell command, flags, and simulated POSIX output.
bit-pdf merge file1.pdf file2.pdf -o merged.pdf
Engineered for Clean Separation
Bit PDF Reader is split into 6 focused Rust crates with zero circular dependencies, strict memory caches, and isolated subsystems.
Dual-Pane Terminal Viewer
Powered by Ratatui & Crossterm. Renders TrueColor half-blocks, handles asynchronous keyboard loops, fuzzy file pickers, and live search highlight markers.
Structural & Render Core
Pure-Rust lopdf object graph manipulator. Merges, splits, extracts, rotates, and deletes pages with atomic staging (tempfile) and dynamic PDFium rasterization.
Asynchronous OCR Pipeline
Background Tesseract engine runner with Otsu binarization, multi-language detection (eng+ind), cancellation channels, and sandwich PDF creation.
SQLite & LRU Page Cache
Stores bookmarks, recent files, reading coordinates, and task history in SQLite with WAL mode (~/.local/share/pdfx/pdfx.db) with strict memory bounds.
Domain Types & POSIX Rules
Zero-dependency domain models, page range parser ("1-3,5,10-15"), custom Error hierarchies with ThisError, and deterministic POSIX exit codes (0-7).
Vim-Inspired Keybindings
Navigate huge documents without your hands ever leaving the home row.
| Keybinding | Action | Scope | Behavior |
|---|---|---|---|
| j or โ | Scroll Down | Text Pane / List | Scrolls active text viewport downward one line |
| k or โ | Scroll Up | Text Pane / List | Scrolls active text viewport upward one line |
| h / l | Previous / Next Page | Global Reader | Navigates to consecutive document pages instantly |
| Space / Shift+Space | Page Jump (PgDn / PgUp) | Global Reader | Fast scrolling across multi-page chunks |
| / | In-Document Search | Interactive Prompt | Opens search prompt; live highlights matches in yellow |
| n / N | Next / Previous Match | Search Mode | Cycles focus across document search hits |
| g | Jump to Page Dialog | Modal Dialog | Prompts for page index and jumps with validation |
| b | Toggle Bookmark | Persistence | Saves/removes current page in SQLite database |
| f | Fuzzy File Picker | Navigation | Interactive directory browser to select another PDF |
| i | Document Info Modal | Metadata | Displays encryption, author, version, and page sizes |
| ? | Help & Credits | Overlay | Renders full cheatsheet and project credits modal |
| Esc / q | Dismiss / Quit | Application | Closes dialog or cleanly exits raw terminal mode |
POSIX Standard Exit Codes
Never guess whether a PDF operation succeeded, failed due to bad input ranges, encountered an encrypted stream, or timed out.
Bit PDF Reader returns deterministic process exit codes from 0 to 7, matching POSIX standards and making bash conditional pipelines robust.
bit-pdf merge in1.pdf in2.pdf -o out.pdf
case $? in
0) echo "Merge succeeded!" ;;
2) echo "Error: Invalid argument or range" ;;
3) echo "Error: Input file missing/unreadable" ;;
5) echo "Error: Encrypted or corrupted PDF" ;;
*) echo "Error: Other failure occurred" ;;
esac
| Code | Constant | Meaning & Trigger |
|---|---|---|
| 0 | SUCCESS | Operation completed successfully without issues |
| 1 | GENERAL_ERROR | Unclassified runtime or unexpected system failure |
| 2 | INVALID_ARGS | Malformed page range (e.g. 5-2), missing flag, or bad option |
| 3 | INPUT_ERROR | File not found, permission denied, or unreadable source file |
| 4 | OUTPUT_ERROR | Destination unwritable, disk full, or rename collision |
| 5 | PDF_ERROR | Corrupted, password-protected, or unparseable PDF stream |
| 6 | OCR_ERROR | Tesseract missing, language pack absent, or OCR timeout |
| 7 | CANCELLED | Process cleanly aborted by SIGINT (Ctrl+C) signal |
Install via GitHub
Bit PDF Reader is distributed directly and exclusively through GitHub. Zero external repositories or third-party AUR accounts required. Choose your Linux distribution below:
Run the official automated GitHub installer directly in your terminal:
curl -fsSL https://raw.githubusercontent.com/MI-Syafaudin/bit-pdf-reader/master/install.sh | bash
Or using wget:
wget -qO- https://raw.githubusercontent.com/MI-Syafaudin/bit-pdf-reader/master/install.sh | bash
Optional OCR Engine (Tesseract)
To extract text from scanned documents, install Tesseract from your distribution repository:
Created & Maintained by MI_Syafaudin
Bit PDF Reader is built with love for the Linux terminal ecosystem. Designed to give users sovereign, private, and blazingly fast PDF capabilities without bloated Electron software or cloud upload dependencies.