Created
April 24, 2025 15:29
-
-
Save juice500ml/94f660651c6c5a43d3f4e03ad7ef45c7 to your computer and use it in GitHub Desktop.
PDF merger
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
from pypdf import PdfWriter | |
pdfs = sorted(str(x) for x in Path(".").glob("*.pdf") if str(x) != "full.pdf") | |
merger = PdfWriter() | |
for pdf in pdfs: | |
print(pdf) | |
merger.append(pdf) | |
merger.write("full.pdf") | |
merger.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment