import PyPDF2 filenames = ['cover.pdf', 'content1.pdf', 'content2.pdf', 'content3.pdf'] merger = PyPDF2.PdfFileMerger() for filename in filenames: merger.append(PyPDF2.PdfFileReader(filename)) merger.write('合并.pdf')
import PyPDF2 filenames = ['cover.pdf', 'content1.pdf', 'content2.pdf', 'content3.pdf'] merger = PyPDF2.PdfFileMerger() for filename in filenames: merger.append(PyPDF2.PdfFileReader(filename)) merger.write('合并.pdf')