fun

1
2
3
4
5
6
7
8
9
10
from PyPDF2 import PdfFileReader, PdfFileWriter
pdfs = ['pdf/01.pdf','pdf/02.pdf']
pdf_writer = PdfFileWriter()
for pdf_path in pdfs:
pdf_reader = PdfFileReader(pdf_path)
for page in range(pdf_reader.getNumPages()):
pdf_writer.addPage(pdf_reader.getPage(page))

with open('pdf/合并.pdf', 'wb') as out:
pdf_writer.write(out)

视频演示

https://www.ixigua.com/6852167552362086926/