No description
Find a file
edjmir 4f1dd0d20d
Some checks failed
CI / Linux (build + clippy + test) (push) Has been cancelled
feat(OPDF #1): Add hyperlinks with destination previews
Hovering a link outlines it and, after 350 ms, shows a preview of where it
leads (rendered destination region, or the address for web links). A click
follows it; Back/Forward (Alt+Left/Right) return to the previous place.
Only http, https and mailto links are opened.

Also adds docs/CI.md (Forgejo runner setup) and the CI workflow notes.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 10:56:57 -06:00
.cargo Initial public commit 2026-11-15 22:08:20 -06:00
.forgejo/workflows feat(OPDF #1): Add hyperlinks with destination previews 2026-11-17 10:56:57 -06:00
assets/icons Initial public commit 2026-11-15 22:08:20 -06:00
crates feat(OPDF #1): Add hyperlinks with destination previews 2026-11-17 10:56:57 -06:00
docs feat(OPDF #1): Add hyperlinks with destination previews 2026-11-17 10:56:57 -06:00
packaging Initial public commit 2026-11-15 22:08:20 -06:00
tests/corpus feat(OPDF #1): Add hyperlinks with destination previews 2026-11-17 10:56:57 -06:00
.gitignore feat(OPDF #1): Add hyperlinks with destination previews 2026-11-17 10:56:57 -06:00
Cargo.lock Initial public commit 2026-11-15 22:08:20 -06:00
Cargo.toml Initial public commit 2026-11-15 22:08:20 -06:00
CHANGELOG.md feat(OPDF #1): Add hyperlinks with destination previews 2026-11-17 10:56:57 -06:00
CLAUDE.md feat(OPDF #1): Add hyperlinks with destination previews 2026-11-17 10:56:57 -06:00
LICENSE Initial public commit 2026-11-15 22:08:20 -06:00
README.md feat(OPDF #1): Add hyperlinks with destination previews 2026-11-17 10:56:57 -06:00

OpenPdfReader

A native, lightweight PDF reader built in Rust, growing toward feature parity with Adobe Acrobat Pro — reading, OCR, page manipulation, encryption, digital signature validation, form filling, in-place text and image editing, and printing.

Free software, forever. OpenPdfReader is licensed under the GNU GPL v3: the source is open, and any fork must stay open too.

Status — v0.1.0, first release. OpenPdfReader is developed and tested on Linux. It is not a finished product: it is a capable reader/editor whose engine is well ahead of its polish. See Platform support for the honest state of macOS and Windows before you expect them to work.


Features

  • Read: continuous scroll, thumbnails, table of contents, two-page spread, fit-to-width/page, presentation mode, bookmarks, recent files.
  • Search & select: full-text search with highlighting; text selection and copy.
  • Links: follow internal and web links; hover a link to preview where it leads (a citation, a glossary entry, a slide) without losing your place, and go Back with Alt+Left.
  • Annotate: highlight, underline and strike through text in your choice of colours; type text boxes straight onto a page; select, recolour, move, re-edit and delete annotations — all saved into the file.
  • Organize pages: reorder, delete, extract, rotate, and merge PDFs — with a PDF-Arranger-style multi-select grid.
  • OCR: recognize scanned pages with Tesseract and overlay an invisible, searchable text layer; per-page or whole-document batch, with language selection.
  • Security: open password-protected files; save AES-256 protected copies with per-permission restrictions (qpdf); read and validate existing digital signatures.
  • Edit: fill AcroForm fields (text, checkbox, choice, radio); replace a text run in place, keeping its position and font (embedding the matching system font when needed); swap an image for another, or save a picture out of a page.
  • Print: through the system print dialog, with the on-screen edits applied.
  • Undo / redo (Ctrl+Z / Ctrl+Y) across every edit kind.

The full roadmap and the architecture notes live in CLAUDE.md.


Platform support

OpenPdfReader depends on mature C libraries (Poppler for rendering, Tesseract for OCR) and two command-line tools at runtime (qpdf, fontconfig's fc-match). How well each platform is served today:

Platform State Notes
Linux ✅ Supported Developed and tested here. All features work.
macOS ⚠️ Experimental The libraries exist via Homebrew and it should build, but it is unverified. Printing is disabled (no XDG portal — see below).
Windows 🔴 Not supported yet Poppler/Tesseract on Windows need MSYS2/vcpkg and are untested. fc-match and the print portal do not exist there.

Two features degrade off Linux by design, rather than crashing:

  • Printing uses the freedesktop XDG desktop portal (org.freedesktop.portal.Print), which is Linux/BSD-only. On other platforms the app reports printing as unsupported and prints nothing (it will never blind-print to a default printer).
  • Font substitution when editing text uses fc-match. Without it, the editor falls back to the standard base-14 fonts instead of embedding your installed typeface — everything still works, the look may differ slightly.

Cross-platform CI (macOS, Windows) is on the roadmap; until it is green, treat those platforms as unproven.


Installing (Linux)

There is no distro package yet. Build from source — it is the most open path, and the one this section documents. A Flatpak bundle (which would carry Poppler/Tesseract/qpdf with the app, so nothing needs installing) is the planned route for end users; see PACKAGING.md.

1. Install the build & runtime dependencies

Fedora:

sudo dnf install gcc gcc-c++ make pkg-config clang \
    poppler-glib-devel cairo-devel cairo-gobject-devel glib2-devel \
    fontconfig-devel libxkbcommon-devel wayland-devel libxcb-devel \
    tesseract tesseract-devel leptonica-devel tesseract-langpack-eng \
    tesseract-langpack-spa qpdf

Debian / Ubuntu:

sudo apt install build-essential pkg-config clang libclang-dev \
    libpoppler-glib-dev libcairo2-dev libglib2.0-dev \
    libfontconfig1-dev libxkbcommon-dev libwayland-dev \
    libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev \
    libtesseract-dev libleptonica-dev \
    tesseract-ocr tesseract-ocr-eng tesseract-ocr-spa qpdf

Arch:

sudo pacman -S base-devel clang pkgconf \
    poppler-glib cairo glib2 fontconfig libxkbcommon wayland libxcb \
    tesseract tesseract-data-eng tesseract-data-spa leptonica qpdf

clang (the full package, not just the libs) is needed so bindgen can build the Tesseract -sys crates. qpdf and fc-match (from fontconfig) are needed at runtime, on your PATH.

2. Install Rust

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

OpenPdfReader needs Rust 1.85 or newer (Rust 2021 edition).

3. Build and run

git clone https://edjmir.com/edjmir/OpenPdfReader.git
cd OpenPdfReader
cargo build --release
./target/release/openpdfreader            # or: cargo run --release

4. (Optional) Install into your desktop

install -Dm755 target/release/openpdfreader ~/.local/bin/openpdfreader
install -Dm644 packaging/openpdfreader.desktop \
    ~/.local/share/applications/openpdfreader.desktop
install -Dm644 assets/icons/openpdfreader.svg \
    ~/.local/share/icons/hicolor/scalable/apps/openpdfreader.svg
update-desktop-database ~/.local/share/applications 2>/dev/null || true

Building notes

  • .cargo/config.toml carries a Fedora-specific bindgen workaround (-I/usr/lib/clang/<v>/include) so libclang finds its builtin headers when only clang-libs is present. With the full clang package installed it is harmless; if your clang version differs and the build complains, adjust or remove that line.

  • The first build is slow (Slint + the C-binding crates). Subsequent builds are cached.

  • Run the quality gates the project holds itself to:

    cargo clippy --workspace --all-targets -- -D warnings
    cargo test --workspace -- --test-threads=1
    

    Tests run single-threaded because Poppler is thread-affine.


Contributing

OpenPdfReader is GPL v3 — read it, run it, change it, share it. Issues and merge requests are welcome. Before submitting code, please make cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace pass. The architecture, conventions and roadmap are documented in CLAUDE.md.


License

Copyright © OpenPdfReader contributors.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3. It is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the LICENSE file for the full text.