Skip to content

A PDF manipulation and access application developed in Python predominantly built using the PyMuPDF and CustomTkinter modules.

License

Notifications You must be signed in to change notification settings

lefkovitzj/PyPdfApp

Repository files navigation


PyPdfApp

A free and open-source PDF manipulation and access application.

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. License
  6. Contact
  7. Acknowledgments

About The Project

Application demo using the demo.pdf file

This is an example of app.py being used to open the demo.pdf file.

Built With

  • Python
  • CustomTinter
  • PyMuPdf
  • Pillow
  • Requests
  • PyCryptodome
  • Flask (optional, used only for the Public Key server)

(back to top)

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

Begin by downloading the Python programming language from python.org, and make sure to include PIP in the installation process.

  • CustomTkinter
    pip install customtkinter
  • Pillow
    pip install pillow
  • PyMuPDF
    pip install pymupdf
  • Requests
    pip install requests
  • PyCryptodome
    pip install pycryptodome
  • Flask (optional, used only for the Public Key server)
    pip install flask

Installation

  1. Download all .py files in this repository as well as the settings.json file.

  2. Configure application settings in settings.json to your liking:

    • app_max_zoom_scale (Default 2 = 200% maximum zoom)
    • ask_save_before_exit (Default True = pop-up on exit if unsaved changes have been made)
    • allow_keyboard_events (Default True = enable keyboard shortcuts within the application)

(back to top)

Usage

Start the app as follows:

  • Run the app.py file from the command line, your IDE of choice, or simply by opening the file with Python.
  • The app will launch File Explorer, use it to select a PDF file to open.

Application GUI

Once a PDF file is selected, you will see the following user interface sections (visible in demo above):

  • Menu:
    • Select submenu.
    • Navigate through a PDF's pages.
    • Save the open PDF file.
    • Open a PDF file.
    • Create a new blank PDF.
    • Close the open PDF file.
    • Adjust the page zoom.
    • View the page number.
  • Submenu:
    • Button #1
    • Button #2
    • Button #3
    • Button #4
  • File Selection Menu:
    • Each open PDF file's name is shown, with a leading "*" indicating unsaved changes and a trailing "|" and number indicating a file with the same name as another that is open already.
  • PDF viewer:
    • Page render
    • Scrollbars

The following submenus are available, with different actions for each of the four (4) submenu buttons:

  1. Pages:
    • Move page up
    • Move page down
    • Rotate Left
    • Rotate Right
  2. Encrypt & Compress:
    • Set PDF encryption
    • Remove PDF encryption
    • Compress PDF (basic)
    • Compress PDF (maximum)
  3. Insert:
    • Insert PDF
    • Insert Blank
    • Watermark Page
    • Watermake Document
  4. Extract:
    • Delete Page
    • Extract Text
    • Extract Images
    • Screenshot Page
  5. Meta Data:
    • Set Author
    • Set Title
    • Set Subject
    • Add Keywords
  6. Signatures
    • Sign PDF
    • Verify Signature
    • Add Signer Account
    • Set Signer Account



Application Hotkeys

Unless disabled in settings.json, the following keyboard shortcuts are available in the application. Please note: most of these are only available when a PDF is open.

  • Control-o: Open a new PDF file.
  • Control-w: Close the open PDF file.
  • Control-n: Create a new blank PDF.
  • Control-s: Save the open PDF file.
  • Right arrow: Navigate to the next page in the PDF file.
  • Left arrow: Navigate to the prior page in the PDF file.
  • Control-plus (Ctrl+): Increase Zoom by 25%.
  • Control-minus (Ctrl-): Decrease Zoom by 25%.

(back to top)

Roadmap

  • Add license agreement screen on first use. (Completed v1.1)
  • Create update-checker on startup. (Completed v1.1)
  • Allow user-created metadata. (Completed v1.2)
    • Add metadata configuration submenu.
    • Add optional metadata to save_pdf() in save.py.
  • Add md5 or SHA hash of source code to settings.json. (Completed v1.3)
  • Add file tampering checker utility application. (Completed v1.3)
  • Add page rotation feature. (Completed v1.4)
  • Add watermark feature. (Completed v1.4)
  • Add digital signature creation and verification systsm.
  • Add a "red pen markup" feature to draw on PDF pages.
  • Add functionality for multiple PDF files at once.
  • Add functionality to create a new PDF from a blank page.
  • Manipulate links within a PDF.
  • Create a "Redact" feature.
  • Allow user-adjusted keybinds.
  • Add PDF to DOCX file conversion.

See the open issues to add to the list of proposed features (and known issues).

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Joseph Lefkovitz - GitHub - LinkedIn

Project Link: https://github.com/lefkovitzj/PyPdfApp

(back to top)

Acknowledgments

  • PyMuPDF, which was used in all the under-the-hood PDF manipulation and access functions.
  • CustomTkinter, which was used to create most of the modern user interface elements.
  • Pillow, which was used in the PDF page rendering process.
  • PyCryptodome, which was used in the PDF signature functions.
  • Requests, which was used in the update launcher process.
  • Flask, which was used for the PDF signer account public key.
  • othneildrew's Best-README-Template, which was used in a modified form for this project's README.md file.

(back to top)

About

A PDF manipulation and access application developed in Python predominantly built using the PyMuPDF and CustomTkinter modules.

Topics

Resources

License

Stars

Watchers

Forks

Languages