Last active
September 30, 2015 09:03
-
-
Save reuf/d9e84f09ece78e0e5871 to your computer and use it in GitHub Desktop.
This file contains 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
# Loading the pyPdf Library | |
from pyPdf import PdfFileWriter, PdfFileReader | |
import os | |
# Creating a routine that appends files to the output file | |
def append_pdf(input,output): | |
[output.addPage(input.getPage(page_num)) for page_num in range(input.numPages)] | |
# Creating an object where pdf pages are appended to | |
output = PdfFileWriter() | |
all_pdfs = [ f for f in listdir(os.getcwd()) if f.endswith(".pdf") ] | |
for pdf_file in all_pdfs: | |
print(pdf_file) | |
# append_pdf(PdfFileReader(file(pdf_file,"rb")),output) | |
# output.write(file("SveZajedno.pdf","wb")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment