Skip to content

metaescape/pqreader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PQReader

A minimalistic pdf and epub Reader depending on PyMuPDF and PyQt6.

The core functionality of PQReader is directly based on eaf-pdf-viewer .

Installation

git clone --depth=1 https://github.com/metaescape/pqreader.git
cd pqreader

# submodules pull with depth=1
git submodule update --init --recursive --depth=1

dependencies

You can create a virtual environment before installing the dependencies (Optional but recommended):

python -m venv pqreader-venv
. pqreader-venv/bin/activate
python -m pip install --upgrade pip

Then install the dependencies using pip:

pip install PyQt6 PyQt6-Qt6 PyQt6-sip PyMuPDF packaging

Usage

preview the pdf/epub file

python main.py -f /path/to/file.pdf
python main.py -f /path/to/file.epub

Features and Development

Currently , it provides the core features of a pdf/epub reader:

  • smooth scrolling
  • text selection (then C-c to copy)
  • cursor hover detection
  • link jumping (C-t to toggle the last position)
  • PGUP/up/C-u and PGDN/down/C-d to scroll half page
  • = to zoom in and - to zoom out, 0 to reset zoom
  • C-q to quit

The full potential of a pdf/epub reader can be unlocked by extending the Reader class in reader.py with additional Qt widgets, such as:

  • Add a toolbar for quick access to common actions.
  • Integrating a right-click context menu for text highlighting and annotations.
  • Implementing a search bar for efficient text search.
  • Add a Table of Contents (ToC) sidebar for better document navigation.

all the methods that are needed to implement these features are already provided in Reader class (inherited from PdfViewerWidget of eaf-pdf-viewer).

test

# profile fast scroll, it will generate a report in logs/ directory
python test.py -f /path/to/file.pdf --scroll 

# profile cursor random move, you may need to modify the cursor range depending on your screen size
python test.py -f /path/to/file.pdf --move 

checkout test.py for more test/profile options

License

GPL-3.0 (Same as the eaf-pdf-viewer)

About

pdf and epub reader depending on PyQt6 and PyMuPDF (eaf-pdf-viewer)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages