Skip to content

pawel-ch/pdf-reader

Repository files navigation

PDF Reader

A simple PDF viewer with a continuous view without margins.

Features

  • Continuous view of PDF pages without margins
  • Optimized performance with lazy page loading (only visible pages are rendered)
  • Fullscreen mode toggle with the "f" keyboard shortcut (menu and status bar automatically hide in fullscreen mode)
  • Zoom controls:
    • Zoom in/out with Ctrl+mouse wheel
    • Predefined zoom levels (100%, fit width, fit page) toggled with the "z" key
  • Open PDF files:
    • Via command-line arguments
    • Through the file dialog (Ctrl+O)
  • Page navigation:
    • The current page and total pages are displayed in the status bar
    • Jump to the specific page with Ctrl+G
  • Starts maximized by default

Requirements

  • Python 3.13.1 or higher
  • PySide6
  • PyMuPDF

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd pdf-reader
    
  2. Set up the environment:

    # Using pyenv (optional)
    pyenv local 3.13.1
    
    # Install dependencies with uv
    uv sync
    

Usage

Running the application

python main.py [path/to/file.pdf]

Keyboard shortcuts

  • Ctrl+O: Open a PDF file
  • f: Toggle fullscreen mode
  • z: Cycle through zoom modes (100%, fit width, fit page)
  • Ctrl+G: Go to specific page
  • Ctrl+mouse wheel: Zoom in/out
  • +: Zoom in by 10% increments (rounds to the nearest multiple of 10%)
  • -: Zoom out by 10% increments (rounds to the nearest multiple of 10%)
  • =: Set zoom to 100%
  • Home: Jump to the first page
  • End: Jump to the last page
  • Left/Right arrow keys:
    • Navigate to the previous/next page when the zoom factor is not larger than "fit to width"
    • Scroll left/right when the zoom factor is larger than "fit to width"
  • q or Esc: Exit the application

Development

Environment Setup

  1. Python Version: The project requires Python 3.13.1 or higher. You can use the .python-version file with pyenv.

  2. Dependencies Management:

    • The project uses uv for dependency management
    • Install dependencies with: uv sync
  3. Environment Variables:

    • Copy the .env file and adjust settings as needed
    • Environment variables are loaded using django-environ in python/env.py

Pre-commit Hooks

Before submitting your work:

  1. Add all new files to the git staging area: git add <filename> or git add .
  2. Run pre-commit on all files: pre-commit run --all-files
  3. Fix any issues reported by pre-commit

About

PDF reader for webtoons/manhwa written mostly with Junie

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages