Created
May 12, 2017 02:48
-
-
Save luxin88/d803adce8d794a2f15cf7948b87fe081 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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from pyPdf import PdfFileReader, PdfFileWriter | |
out = PdfFileWriter() | |
for i in range(1, 165): | |
src_pdf = u"/path/to/pdfs/" + str(i) + u".pdf" | |
pdf = PdfFileReader(file(src_pdf, 'rb')) | |
for page in pdf.pages: | |
out.addPage(page) | |
ous = file(u"/path/to/dst/file.pdf", 'wb') | |
out.write(ous) | |
ous.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment