Skip to content

Sahil-Chhoker/PDF-Editor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PDF Editor

This Python script provides a graphical user interface (GUI) for performing various operations on text and PDF files. It allows users to convert text files to PDF, split PDFs, merge PDFs, convert PDFs to images, and convert PDFs to PowerPoint presentations.

Features

  • Convert text files to PDF format
  • Convert Image files to PDF format
  • Split PDF files into multiple PDFs
  • Merge multiple PDF files into a single PDF
  • Convert PDF files to image format (PNG, JPG, etc.)
  • Convert PDF files to PowerPoint presentations

Dependencies

Ensure you have the following dependencies installed:

  • tkinter: Python's standard GUI (graphical user interface) toolkit.
  • os: Provides a portable way of using operating system-dependent functionality.
  • shutil: Provides a higher-level interface for file operations.
  • filedialog from tkinter: Provides dialogs for opening and saving files.
  • pathlib: Provides classes representing filesystem paths.
  • fpdf: A Python library for generating PDF files.
  • PyPDF2: A Python library to work with PDF files.
  • pdf2image: A Python library to convert PDFs to images.
  • dotenv: A Python library to manage environment variables.
  • groupdocs_conversion_cloud: A Python library for converting documents, powered by GroupDocs.
  • img2pdf: A Python library for converting images into PDF files.

Setup

  1. Clone this repository to your local machine.
git clone https://github.com/Sahil-Chhoker/PDF-Editor.git
  1. Navigate to the project directory.
cd PDF-Editor
  1. Create a virtual environment (optional but recommended).
python -m venv env
source env/bin/activate  # On Windows, use `env\Scripts\activate.ps1`
  1. Install the required dependencies using pip.
pip install -r requirements.txt

Installing Poppler

NOTE: You ONLY need popler if you are converting your pdf to images, the rest works okay.

  1. For Windows Users:

    • Go to the Poppler Windows Releases page.
    • Download and install the latest release of Poppler for Windows.
    • Once installed, locate the path to the bin directory of your Poppler installation.

    For Mac and Linux Users:

    • Visit the Poppler Official Website.
    • Download and install the latest release of Poppler for your OS.
    • Once installed, note down the path to the bin directory of your Poppler installation.
  2. Specify Poppler Path in the Script:

    • Open the .env file in your PDF Editor project directory.
    • Replace the placeholder your_poppler_path with the actual path to the bin directory of your Poppler installation.
  3. Set up environment variables for authentication with the GroupDocs API. Create a .env file in the root directory of the project and add your client ID and client secret. (For more information on getting your credentials, visit GroupDocs Dashboard)

    NOTE: You only need the API credentials ONLY if you are converting pdf to pptx, everything else works on your local machine.

CLIENT_ID=your_client_id_here
CLIENT_SECRET=your_client_secret_here
POPPLER_PATH=your_poppler_path

Usage

  1. Run python main.py in your terminal.
  2. Click on an operation button to start.
  3. Follow on-screen prompts to select files and folders.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

License

This project is licensed under the MIT License.

Author

Sahil Chhoker

About

an almighty pdf editor in python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages