pdf merge script done, merges all pdfs within a directory
This commit is contained in:
parent
1aed501075
commit
2c97267e4a
8
Python_Scripts/DownloadSorter/Getting_Started.md
Normal file
8
Python_Scripts/DownloadSorter/Getting_Started.md
Normal 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
|
||||
BIN
Python_Scripts/PDFMerger/4B_final_part_1.pdf
Normal file
BIN
Python_Scripts/PDFMerger/4B_final_part_1.pdf
Normal file
Binary file not shown.
BIN
Python_Scripts/PDFMerger/4B_final_part_2.pdf
Normal file
BIN
Python_Scripts/PDFMerger/4B_final_part_2.pdf
Normal file
Binary file not shown.
@ -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
|
||||
@ -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')
|
||||
Loading…
Reference in New Issue
Block a user