Program:
from PyPDF2 import PdfMerger
merger = PdfMerger()
pdf_files = ['P1.pdf', 'P2.pdf']
for pdf_file in pdf_files:
merger.append(pdf_file)
merger.write("p3.pdf")
merger.close()
LOGIC:
Here we are taking two pdf i.e. p1 and p2 which finally is merged and is stored in p3
Now, p3 pdf has merged content of p1 and p2 pdf
0 Comments