/pdf-encryption-remover

This project provides a set of Python scripts for removing encryption from PDF files. The tool can handle PDFs that are encrypted but do not require a password for opening

Primary LanguagePythonMIT LicenseMIT

PDF Encryption Remover

This project provides a Python script for removing encryption from PDF files. The tool can handle PDFs that are encrypted with or without a password. It includes a graphical user interface built with tkinter for easy use.

💪 Features

  • Modern GUI: User-friendly interface with improved styling, colors, and layout.
  • Batch Processing: Process multiple PDFs at once with progress tracking.
  • Password Support: Handles encrypted PDFs with optional password input.
  • Progress Tracking: Real-time progress bar and status updates during processing.
  • Error Handling: Comprehensive error handling with user-friendly messages.
  • Command-Line Interface: Full CLI support for automation and scripting.

📄 Requirements

  • Python 3.6+
  • PyMuPDF (pymupdf): For handling PDF files.
  • tkinter: For the graphical user interface (comes with Python standard library).

🔽 Installation

  1. Clone the repository:

    git clone https://github.com/oop7/pdf-encryption-remover.git
    cd pdf-encryption-remover
  2. Install required dependencies:

    pip install -r requirements.txt

💻 Usage

GUI Mode (Default)

Run the GUI application:

python main.py

Command-Line Mode

For headless or automated use:

python main.py input.pdf output.pdf [-p PASSWORD]

Batch processing:

python main.py input_directory output_directory -d [-p PASSWORD]

Examples:

# Single file without password
python main.py encrypted.pdf decrypted.pdf

# Single file with password
python main.py encrypted.pdf decrypted.pdf -p mypassword

# Batch process directory
python main.py /path/to/pdfs /path/to/output -d

How to Use GUI:

  1. Batch Mode: Check "Batch Mode" to process multiple PDFs in a directory (labels will update automatically).
  2. File Selection: Click "Browse" next to "Input" to select your PDF file or directory.
  3. Output Location: Click "Browse" next to "Output" to choose where to save the decrypted file(s).
  4. Password: Enter a password if your PDF(s) are encrypted (leave blank if not encrypted).
  5. Process: Click "Remove Encryption" to start processing.
  6. Monitor Progress: Watch the progress bar and status updates during processing.
  7. A success message will appear when processing is complete.

🛠️ Troubleshooting

  • File not found: Ensure the input PDF path is correct and the file exists.
  • Incorrect password: If the PDF is encrypted, provide the correct password.
  • Permission denied: Make sure you have write permissions for the output directory.
  • PDF not encrypted: The tool will still create a copy without encryption.

📝 License

This project is licensed under the MIT License - see the LICENSE file for details.

Disclaimer

This tool is intended for legal and ethical use only. It must only be used on PDF files that you own or have explicit permission to modify. The authors are not responsible for any misuse of this software.