pdf merge script done, merges all pdfs within a directory

This commit is contained in:
Jacob Delgado 2023-09-13 03:21:51 -07:00
parent 1aed501075
commit 2c97267e4a
5 changed files with 20 additions and 5 deletions

View File

@ -0,0 +1,8 @@
# Get Started
## Dependencies
- Uses standard python3 libraries
## Usage
- Place the file within the folder(directory) that you want to organize
- Run the file
- Add to task scheduler if you want it to run any time a new file is added to the folder

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,9 @@
# Getting Started
## Dependencies
- Requires python3 and PyPDF2 library.
- Requires python3 and pypdf library.
-Use pip to install.
## Usage
- Place file in folder(directory) with the pdf files you want to merge
- Files should be named alphabetically and use underscores `CS_Quiz_1.pdf`
- Run the file

View File

@ -1,10 +1,12 @@
import sys
import PyPDF2
from pypdf import PdfMerger
import os
merger = PyPDF2.PdfFileMerger()
for file in os.listdir(os.curdir):
merger = PdfMerger()
for file in os.listdir(os.getcwd()):
if file.endswith(".pdf"):
print(file)
merger.append(file)
merger.write('CombinedFile.pdf')