/pdf-keep-first-page

This Python script opens all PDF files in a directory, keeps the first page, removes the others, and saves the result in a new directory.

Primary LanguagePythonMIT LicenseMIT

PDF Keep First Page

This Python script opens all PDF files in a directory, keeps the first page, removes the others, and saves the result in a new directory.

How to Use

Clone the Repository

git clone git@github.com:lichti/pdf-keep-first-page.git
cd pdf-keep-first-page

Create a Virtual Environment

python3 -m venv venv
source venv/bin/activate

Install Dependencies

pip install -r requirements.txt

Create the Input Directory

mkdir input

Run the Script

python3 pdf_keep_first_page.py

Check the Output Files

The processed files will be saved in the output directory.

Dependencies

Ensure that the requirements.txt file is present in the repository and contains the necessary dependencies, such as PyPDF2. Here is an example of what the requirements.txt could look like:

PyPDF2