Skip to content

Commit 3aed414

Browse files
Another Chapter Ends
1 parent cf9cff6 commit 3aed414

File tree

14 files changed

+46
-1
lines changed

14 files changed

+46
-1
lines changed

CNAME

100644100755
File mode changed.
Binary file not shown.
867 KB
Binary file not shown.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#! /usr/bin/python3.5
2+
3+
4+
"""
5+
6+
Author: Samrat Banerjee
7+
Dated: 27/08/2018
8+
Description: Project: Combines all the PDFs in the current working directory into a single PDF
9+
10+
"""
11+
12+
import PyPDF2, os
13+
14+
# Get all the PDF filenames.
15+
pdfFiles = []
16+
for filename in os.listdir('.'):
17+
if filename.endswith('.pdf'):
18+
pdfFiles.append(filename)
19+
pdfFiles.sort(key=str.lower)
20+
21+
pdfWriter=PyPDF2.PdfFileWriter()
22+
23+
# Loop through all the PDF files.
24+
for filename in pdfFiles:
25+
pdfFileObj=open(filename,'rb')
26+
pdfReader=PyPDF2.PdfFileReader(pdfFileObj)
27+
# Loop through all the pages (except the first) and add them.
28+
for pageNum in range(1,pdfReader.numPages):
29+
pageObj=pdfReader.getPage(pageNum)
30+
pdfWriter.addPage(pageObj)
31+
32+
# Save the resulting PDF to a file.
33+
pdfOutput = open('allminutes.pdf', 'wb')
34+
pdfWriter.write(pdfOutput)
35+
pdfOutput.close()
506 KB
Binary file not shown.
41.6 KB
Binary file not shown.
35.6 KB
Binary file not shown.
241 KB
Binary file not shown.
294 KB
Binary file not shown.
281 KB
Binary file not shown.

0 commit comments

Comments
 (0)