I am trying to merge a bunch of pdf files into one file. After doing that I need to take that file and merge it with a second file, but it needs to go (page 1 file A, page 1 file B, page 2 file A, page 2 file B, …) I think that I might be close to making that work, but honestly I’ve watched a bunch of videos and a looked at a bunch of tutorials and I’m just lost. Thanks if anyone can help!
from PyPDF2 import PdfFileMerger, PdfFileReader
userpdflocation = os.getcwd() + r"\Print Me\"
mergedObject = PdfFileMerger()
for fileNumber in range(1, 300):
mergedObject.append(PdfFileReader(‘OPC_’ + str(fileNumber)+ ‘.pdf’, ‘rb’))
out = PyPDF2.PdfFileWriter()
for page1, page 2 in zip(in1 .pages, in2.pages):
with opern(‘outpath.pdf’, ‘wb’ as