Coding/Python Matlab
PyPDF2 PDF split, merge
smores
2022. 3. 28. 22:47
# pip install pypdf2
import PyPDF2
def merge_pdfs(_pdfs):
mergeFile = PyPDF2.PdfFileMerger()
for _pdf in _pdfs:
mergeFile.append(PyPDF2.PdfFileReader(_pdf, 'rb'))
mergeFile.write("New_Merged_File.pdf")
if __name__ == '__main__':
_pdfs = ['1.pdf', '2.pdf', '3.pdf']
merge_pdfs(_pdfs)