Skip to content

Commit

Permalink
Remove Python syntax error from merge multiple PDFs
Browse files Browse the repository at this point in the history
  • Loading branch information
cclauss authored Apr 27, 2021
1 parent 38d9e16 commit cd4cd32
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions Python projects/Merge Multiple PDF/source-code.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,8 @@
import os
#var = os.getcwd() For extracting from enother folder
merger = PdfFileMerger()
for items in os.listdir():
if items.endswith('.pdf')
merger.append(items)
for filename in os.listdir():
if filename.endswith('.pdf'):
merger.append(filename)
merger.write("Final_pdf.pdf")
merger = PdfFileMerger()
fin = file(originalFile, 'rb')
merger.append(PdfFileReader(fin))
fin.close()
os.remove(originalFile)
merger.close()

0 comments on commit cd4cd32

Please sign in to comment.