Last active
October 27, 2021 19:25
-
-
Save PfannenHans/2f53945b3e581823a5706b9da8f80043 to your computer and use it in GitHub Desktop.
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
| #!/usr/bin/env python3 | |
| import sys | |
| import PyPDF2 | |
| if __name__ == "__main__": | |
| pdfWriter = PyPDF2.PdfFileWriter() | |
| for filename in sys.argv[1:]: | |
| with open(filename, "rb") as pdfFileObj: | |
| print(filename) | |
| pdfReader = PyPDF2.PdfFileReader(pdfFileObj) | |
| for page in pdfReader.pages: | |
| pdfWriter.addPage(page) | |
| with open("output.pdf", "wb") as pdfOutput: | |
| pdfWriter.write(pdfOutput) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment