1 import PyPDF2 2 filenames = [‘cover.pdf‘, ‘content1.pdf‘, ‘content2.pdf‘, ‘content3.pdf‘] 3 merger = PyPDF2.PdfFileMerger() 4 for filename in filenames: 5 merger.append(PyPDF2.PdfFileReader(filename)) 6 merger.write(‘合并.pdf‘)
2023-11-03 13:48:58
1 import PyPDF2 2 filenames = [‘cover.pdf‘, ‘content1.pdf‘, ‘content2.pdf‘, ‘content3.pdf‘] 3 merger = PyPDF2.PdfFileMerger() 4 for filename in filenames: 5 merger.append(PyPDF2.PdfFileReader(filename)) 6 merger.write(‘合并.pdf‘)